aboutsummaryrefslogtreecommitdiff
path: root/chvt.c
diff options
context:
space:
mode:
Diffstat (limited to 'chvt.c')
-rw-r--r--chvt.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/chvt.c b/chvt.c
index c5c86b613..ab0e9218f 100644
--- a/chvt.c
+++ b/chvt.c
@@ -15,18 +15,19 @@
15#define VT_ACTIVATE 0x5606 /* make vt active */ 15#define VT_ACTIVATE 0x5606 /* make vt active */
16#define VT_WAITACTIVE 0x5607 /* wait for vt active */ 16#define VT_WAITACTIVE 0x5607 /* wait for vt active */
17 17
18const char chvt_usage[] =
19 "chvt N\n"
20#ifndef BB_FEATURE_TRIVIAL_HELP
21 "\nChanges the foreground virtual terminal to /dev/ttyN\n"
22#endif
23 ;
18 24
19int chvt_main(int argc, char **argv) 25int chvt_main(int argc, char **argv)
20{ 26{
21 int fd, num; 27 int fd, num;
22 28
23 if ((argc != 2) || (**(argv + 1) == '-')) { 29 if ((argc != 2) || (**(argv + 1) == '-'))
24 usage ("chvt N\n" 30 usage (chvt_usage);
25#ifndef BB_FEATURE_TRIVIAL_HELP
26 "\nChanges the foreground virtual terminal to /dev/ttyN\n"
27#endif
28 );
29 }
30 fd = get_console_fd("/dev/console"); 31 fd = get_console_fd("/dev/console");
31 num = atoi(argv[1]); 32 num = atoi(argv[1]);
32 if (ioctl(fd, VT_ACTIVATE, num)) { 33 if (ioctl(fd, VT_ACTIVATE, num)) {