diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2003-12-20 06:00:08 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2003-12-20 06:00:08 +0000 |
commit | 02e035550456f7ebce6306f6023e87a7c1d44749 (patch) | |
tree | 67f124028fe1b297bab3c325e6f5783ac20004a6 /console-tools | |
parent | 236e93d133ff80fae0a0fb5f8912a049e6ead4ac (diff) | |
download | busybox-w32-02e035550456f7ebce6306f6023e87a7c1d44749.tar.gz busybox-w32-02e035550456f7ebce6306f6023e87a7c1d44749.tar.bz2 busybox-w32-02e035550456f7ebce6306f6023e87a7c1d44749.zip |
Use bb_xopen
Diffstat (limited to 'console-tools')
-rw-r--r-- | console-tools/dumpkmap.c | 6 | ||||
-rw-r--r-- | console-tools/loadacm.c | 5 | ||||
-rw-r--r-- | console-tools/loadfont.c | 4 | ||||
-rw-r--r-- | console-tools/openvt.c | 10 |
4 files changed, 6 insertions, 19 deletions
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c index 85926556c..19ba77d82 100644 --- a/console-tools/dumpkmap.c +++ b/console-tools/dumpkmap.c | |||
@@ -51,11 +51,7 @@ int dumpkmap_main(int argc, char **argv) | |||
51 | bb_show_usage(); | 51 | bb_show_usage(); |
52 | } | 52 | } |
53 | 53 | ||
54 | fd = open(CURRENT_VC, O_RDWR); | 54 | fd=bb_xopen(CURRENT_VC, O_RDWR); |
55 | if (fd < 0) { | ||
56 | bb_perror_msg("Error opening " CURRENT_VC); | ||
57 | return EXIT_FAILURE; | ||
58 | } | ||
59 | 55 | ||
60 | write(1, magic, 7); | 56 | write(1, magic, 7); |
61 | 57 | ||
diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c index 640aa4401..edaf51afb 100644 --- a/console-tools/loadacm.c +++ b/console-tools/loadacm.c | |||
@@ -37,10 +37,7 @@ int loadacm_main(int argc, char **argv) | |||
37 | bb_show_usage(); | 37 | bb_show_usage(); |
38 | } | 38 | } |
39 | 39 | ||
40 | fd = open(CURRENT_VC, O_RDWR); | 40 | fd = bb_xopen(CURRENT_VC, O_RDWR); |
41 | if (fd < 0) { | ||
42 | bb_perror_msg_and_die("Error opening " CURRENT_VC); | ||
43 | } | ||
44 | 41 | ||
45 | if (screen_map_load(fd, stdin)) { | 42 | if (screen_map_load(fd, stdin)) { |
46 | bb_perror_msg_and_die("Error loading acm"); | 43 | bb_perror_msg_and_die("Error loading acm"); |
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c index 6108151a6..4580dc4e0 100644 --- a/console-tools/loadfont.c +++ b/console-tools/loadfont.c | |||
@@ -46,9 +46,7 @@ extern int loadfont_main(int argc, char **argv) | |||
46 | if (argc != 1) | 46 | if (argc != 1) |
47 | bb_show_usage(); | 47 | bb_show_usage(); |
48 | 48 | ||
49 | fd = open(CURRENT_VC, O_RDWR); | 49 | fd = bb_xopen(CURRENT_VC, O_RDWR); |
50 | if (fd < 0) | ||
51 | bb_perror_msg_and_die("Error opening " CURRENT_VC); | ||
52 | loadnewfont(fd); | 50 | loadnewfont(fd); |
53 | 51 | ||
54 | return EXIT_SUCCESS; | 52 | return EXIT_SUCCESS; |
diff --git a/console-tools/openvt.c b/console-tools/openvt.c index 269dfc01a..bafd1d0a2 100644 --- a/console-tools/openvt.c +++ b/console-tools/openvt.c | |||
@@ -48,11 +48,8 @@ int openvt_main(int argc, char **argv) | |||
48 | if (!isdigit(argv[1][0])) | 48 | if (!isdigit(argv[1][0])) |
49 | bb_show_usage(); | 49 | bb_show_usage(); |
50 | 50 | ||
51 | vtno = (int) atol(argv[1]); | 51 | /* check for Illegal vt number */ |
52 | 52 | vtno=bb_xgetlarg(argv[1], 10, 1, 12); | |
53 | /* if (vtno <= 0 || vtno > 63) */ | ||
54 | if (vtno <= 0 || vtno > 12) | ||
55 | bb_error_msg_and_die("Illegal vt number (%d)", vtno); | ||
56 | 53 | ||
57 | sprintf(vtname, VTNAME, vtno); | 54 | sprintf(vtname, VTNAME, vtno); |
58 | 55 | ||
@@ -73,8 +70,7 @@ int openvt_main(int argc, char **argv) | |||
73 | close(0); /* so that new vt becomes stdin */ | 70 | close(0); /* so that new vt becomes stdin */ |
74 | 71 | ||
75 | /* and grab new one */ | 72 | /* and grab new one */ |
76 | if ((fd = open(vtname, O_RDWR)) == -1) | 73 | fd = bb_xopen(vtname, O_RDWR); |
77 | bb_perror_msg_and_die("could not open %s", vtname); | ||
78 | 74 | ||
79 | /* Reassign stdout and sterr */ | 75 | /* Reassign stdout and sterr */ |
80 | close(1); | 76 | close(1); |