Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/console-tools/chvt.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/console-tools/chvt.c
r1765 r2725 5 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 6 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 source tree. 8 8 */ 9 10 9 #include "libbb.h" 11 10 12 /* From <linux/vt.h> */ 13 enum { 14 VT_ACTIVATE = 0x5606, /* make vt active */ 15 VT_WAITACTIVE = 0x5607 /* wait for vt active */ 16 }; 17 18 int chvt_main(int argc, char **argv); 19 int chvt_main(int argc, char **argv) 11 int chvt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 12 int chvt_main(int argc UNUSED_PARAM, char **argv) 20 13 { 21 int fd, num; 22 23 if (argc != 2) { 24 bb_show_usage(); 25 } 26 27 fd = get_console_fd(); 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); 14 int num = xatou_range(single_argv(argv), 1, 63); 15 console_make_active(get_console_fd_or_die(), num); 32 16 return EXIT_SUCCESS; 33 17 }
Note:
See TracChangeset
for help on using the changeset viewer.