Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/libbb/get_console.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/libbb/get_console.c
r1765 r2725 6 6 * acknowledge your work. 7 7 * 8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 9 9 */ 10 10 11 //#include <sys/ioctl.h>12 11 #include "libbb.h" 13 14 12 15 13 /* From <linux/kd.h> */ 16 14 enum { KDGKBTYPE = 0x4B33 }; /* get keyboard type */ 17 18 15 19 16 static int open_a_console(const char *fnam) … … 40 37 * if someone else used X (which does a chown on /dev/console). 41 38 */ 42 43 int get_console_fd(void) 39 int FAST_FUNC get_console_fd_or_die(void) 44 40 { 45 41 static const char *const console_names[] = { … … 68 64 } 69 65 70 bb_error_msg ("cannot get file descriptor referring toconsole");71 return fd; /*total failure */66 bb_error_msg_and_die("can't open console"); 67 /*return fd; - total failure */ 72 68 } 69 70 /* From <linux/vt.h> */ 71 enum { 72 VT_ACTIVATE = 0x5606, /* make vt active */ 73 VT_WAITACTIVE = 0x5607 /* wait for vt active */ 74 }; 75 76 void FAST_FUNC console_make_active(int fd, const int vt_num) 77 { 78 xioctl(fd, VT_ACTIVATE, (void *)(ptrdiff_t)vt_num); 79 xioctl(fd, VT_WAITACTIVE, (void *)(ptrdiff_t)vt_num); 80 }
Note:
See TracChangeset
for help on using the changeset viewer.