12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #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;
- }
|