2000-02-09 01:28:47 +05:30
|
|
|
/* vi: set sw=4 ts=4: */
|
1999-10-26 05:02:44 +05:30
|
|
|
/*
|
2003-10-22 16:00:53 +05:30
|
|
|
* Mini chvt implementation for busybox
|
1999-10-26 05:02:44 +05:30
|
|
|
*
|
2004-03-15 13:59:22 +05:30
|
|
|
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
|
2003-10-22 16:00:53 +05:30
|
|
|
*
|
2010-08-16 23:44:46 +05:30
|
|
|
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
1999-10-26 05:02:44 +05:30
|
|
|
*/
|
2011-03-28 03:12:28 +05:30
|
|
|
|
|
|
|
//usage:#define chvt_trivial_usage
|
|
|
|
//usage: "N"
|
|
|
|
//usage:#define chvt_full_usage "\n\n"
|
|
|
|
//usage: "Change the foreground virtual terminal to /dev/ttyN"
|
|
|
|
|
2007-05-27 00:30:18 +05:30
|
|
|
#include "libbb.h"
|
2000-07-09 00:25:24 +05:30
|
|
|
|
2007-10-11 15:35:36 +05:30
|
|
|
int chvt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
2009-11-28 19:48:53 +05:30
|
|
|
int chvt_main(int argc UNUSED_PARAM, char **argv)
|
1999-10-26 05:02:44 +05:30
|
|
|
{
|
2009-11-28 19:48:53 +05:30
|
|
|
int num = xatou_range(single_argv(argv), 1, 63);
|
2008-08-06 05:02:27 +05:30
|
|
|
console_make_active(get_console_fd_or_die(), num);
|
2000-12-01 08:25:13 +05:30
|
|
|
return EXIT_SUCCESS;
|
1999-10-26 05:02:44 +05:30
|
|
|
}
|