1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #include "libbb.h"
- int setconsole_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
- int setconsole_main(int argc UNUSED_PARAM, char **argv)
- {
- const char *device = CURRENT_TTY;
- int reset;
-
- reset = getopt32(argv, "^" "r" "\0" "?1");
- argv += 1 + reset;
- if (*argv) {
- device = *argv;
- } else {
- if (reset)
- device = DEV_CONSOLE;
- }
- xioctl(xopen(device, O_WRONLY), TIOCCONS, NULL);
- return EXIT_SUCCESS;
- }
|