Changeset 1770 in MondoRescue for branches/stable/mindi-busybox/console-tools/chvt.c
- Timestamp:
- Nov 6, 2007, 11:01:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi-busybox/console-tools/chvt.c
r821 r1770 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 "libbb.h" 16 11 17 12 /* From <linux/vt.h> */ … … 21 16 }; 22 17 18 int chvt_main(int argc, char **argv); 23 19 int chvt_main(int argc, char **argv) 24 20 { … … 30 26 31 27 fd = get_console_fd(); 32 num = bb_xgetlarg(argv[1], 10, 0, INT_MAX); 33 if ((-1 == ioctl(fd, VT_ACTIVATE, num)) 34 || (-1 == ioctl(fd, VT_WAITACTIVE, num))) { 35 bb_perror_msg_and_die("ioctl"); 36 } 28 num = xatou_range(argv[1], 1, 63); 29 /* double cast suppresses "cast to ptr from int of different size */ 30 xioctl(fd, VT_ACTIVATE, (void *)(ptrdiff_t)num); 31 xioctl(fd, VT_WAITACTIVE, (void *)(ptrdiff_t)num); 37 32 return EXIT_SUCCESS; 38 33 }
Note:
See TracChangeset
for help on using the changeset viewer.