comparison 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
comparison
equal deleted inserted replaced
1428:e66fb422b78a 1429:8c78a7e5486d
63 63
64 // Redirect stdio to /dev/tty0, with new session ID, so ctrl-c works. 64 // Redirect stdio to /dev/tty0, with new session ID, so ctrl-c works.
65 setsid(); 65 setsid();
66 for (i=0; i<3; i++) { 66 for (i=0; i<3; i++) {
67 close(i); 67 close(i);
68 xopen(TT.console ? TT.console : "/dev/tty0", O_RDWR); 68 // Remember, O_CLOEXEC is backwards for xopen()
69 xopen(TT.console ? TT.console : "/dev/tty0", O_RDWR|O_CLOEXEC);
69 } 70 }
70 71
71 // Can't xexec() here, because we vforked so we don't want to error_exit(). 72 // Can't xexec() here, because we vforked so we don't want to error_exit().
72 toy_exec(toys.optargs); 73 toy_exec(toys.optargs);
73 execvp(*toys.optargs, toys.optargs); 74 execvp(*toys.optargs, toys.optargs);