diff toys/other/oneit.c @ 1429:8c78a7e5486d draft

Disable xopen's default O_CLOEXEC for oneit.
author Rob Landley <rob@landley.net>
date Sat, 09 Aug 2014 23:49:48 -0500
parents 786841fdb1e0
children b2b2d214727a
line wrap: on
line diff
--- a/toys/other/oneit.c	Sat Aug 09 14:33:34 2014 -0500
+++ b/toys/other/oneit.c	Sat Aug 09 23:49:48 2014 -0500
@@ -65,7 +65,8 @@
   setsid();
   for (i=0; i<3; i++) {
     close(i);
-    xopen(TT.console ? TT.console : "/dev/tty0", O_RDWR);
+    // Remember, O_CLOEXEC is backwards for xopen()
+    xopen(TT.console ? TT.console : "/dev/tty0", O_RDWR|O_CLOEXEC);
   }
 
   // Can't xexec() here, because we vforked so we don't want to error_exit().