aboutsummaryrefslogtreecommitdiff
path: root/toys/oneit.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2007-12-09 15:30:36 -0600
committerRob Landley <rob@landley.net>2007-12-09 15:30:36 -0600
commita8f2580e76da09d623f710affad67ab6610b2c03 (patch)
tree96c867366d968dcea3c74cc7db039c66f3acb2eb /toys/oneit.c
parentfece5cb6d796119eccb1ae0074e5b3aaccbb74ee (diff)
downloadtoybox-a8f2580e76da09d623f710affad67ab6610b2c03.tar.gz
Add -c option to oneit, to specify console other than /dev/tty0.
Diffstat (limited to 'toys/oneit.c')
-rw-r--r--toys/oneit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/toys/oneit.c b/toys/oneit.c
index 5fd61df1..8563ecb1 100644
--- a/toys/oneit.c
+++ b/toys/oneit.c
@@ -18,6 +18,8 @@
// PID 1 then reaps zombies until the child process it spawned exits, at which
// point it calls sync() and reboot(). I could stick a kill -1 in there.
+#define TT toy.oneit
+
void oneit_main(void)
{
int i;
@@ -37,7 +39,7 @@ void oneit_main(void)
setsid();
for (i=0; i<3; i++) {
close(i);
- open("/dev/tty0",O_RDWR);
+ xopen(TT.console ? TT.console : "/dev/tty0",O_RDWR);
}
// Can't xexec() here, because we vforked so we don't want to error_exit().