diff toys/oneit.c @ 195:9dc48c97d6f9

Add -c option to oneit, to specify console other than /dev/tty0.
author Rob Landley <rob@landley.net>
date Sun, 09 Dec 2007 15:30:36 -0600
parents 30a6db5a95c2
children d4176f3f3835
line wrap: on
line diff
--- a/toys/oneit.c	Mon Dec 03 20:05:57 2007 -0600
+++ b/toys/oneit.c	Sun Dec 09 15:30:36 2007 -0600
@@ -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 @@
   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().