aboutsummaryrefslogtreecommitdiff
path: root/console-tools/chvt.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-08 12:49:22 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-08 12:49:22 +0000
commit1385899416a4396385ad421ae1f532be7103738a (patch)
treefc4d14a910593d1235318bb36abe5e9f72d2039e /console-tools/chvt.c
parent5625415085e68ac5e150f54e685417c866620d76 (diff)
downloadbusybox-w32-1385899416a4396385ad421ae1f532be7103738a.tar.gz
busybox-w32-1385899416a4396385ad421ae1f532be7103738a.tar.bz2
busybox-w32-1385899416a4396385ad421ae1f532be7103738a.zip
attempt to regularize atoi mess.
Diffstat (limited to 'console-tools/chvt.c')
-rw-r--r--console-tools/chvt.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/console-tools/chvt.c b/console-tools/chvt.c
index aff66e007..bbc5a9c31 100644
--- a/console-tools/chvt.c
+++ b/console-tools/chvt.c
@@ -7,11 +7,6 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include <stdio.h>
11#include <stdlib.h>
12#include <fcntl.h>
13#include <sys/types.h>
14#include <sys/ioctl.h>
15#include "busybox.h" 10#include "busybox.h"
16 11
17/* From <linux/vt.h> */ 12/* From <linux/vt.h> */
@@ -29,7 +24,7 @@ int chvt_main(int argc, char **argv)
29 } 24 }
30 25
31 fd = get_console_fd(); 26 fd = get_console_fd();
32 num = bb_xgetlarg(argv[1], 10, 0, INT_MAX); 27 num = xatoul_range(argv[1], 1, 63);
33 if ((-1 == ioctl(fd, VT_ACTIVATE, num)) 28 if ((-1 == ioctl(fd, VT_ACTIVATE, num))
34 || (-1 == ioctl(fd, VT_WAITACTIVE, num))) { 29 || (-1 == ioctl(fd, VT_WAITACTIVE, num))) {
35 bb_perror_msg_and_die("ioctl"); 30 bb_perror_msg_and_die("ioctl");