diff options
Diffstat (limited to 'console-tools/deallocvt.c')
-rw-r--r-- | console-tools/deallocvt.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c index b2e8e2bef..cd581b1c8 100644 --- a/console-tools/deallocvt.c +++ b/console-tools/deallocvt.c | |||
@@ -10,11 +10,6 @@ | |||
10 | 10 | ||
11 | /* no options, no getopt */ | 11 | /* no options, no getopt */ |
12 | 12 | ||
13 | #include <stdlib.h> | ||
14 | #include <stdio.h> | ||
15 | #include <fcntl.h> | ||
16 | #include <sys/types.h> | ||
17 | #include <sys/ioctl.h> | ||
18 | #include "busybox.h" | 13 | #include "busybox.h" |
19 | 14 | ||
20 | /* From <linux/vt.h> */ | 15 | /* From <linux/vt.h> */ |
@@ -26,15 +21,13 @@ int deallocvt_main(int argc, char *argv[]) | |||
26 | int num = 0; | 21 | int num = 0; |
27 | 22 | ||
28 | switch (argc) { | 23 | switch (argc) { |
29 | case 2: | 24 | case 2: |
30 | if ((num = bb_xgetlarg(argv[1], 10, 0, INT_MAX)) == 0) { | 25 | num = xatoul_range(argv[1], 1, 63); |
31 | bb_error_msg_and_die("0: illegal VT number"); | ||
32 | } | ||
33 | /* Fallthrough */ | 26 | /* Fallthrough */ |
34 | case 1: | 27 | case 1: |
35 | break; | 28 | break; |
36 | default: | 29 | default: |
37 | bb_show_usage(); | 30 | bb_show_usage(); |
38 | } | 31 | } |
39 | 32 | ||
40 | if (-1 == ioctl(get_console_fd(), VT_DISALLOCATE, num)) { | 33 | if (-1 == ioctl(get_console_fd(), VT_DISALLOCATE, num)) { |