summaryrefslogtreecommitdiff
path: root/utils/shd.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1994-08-22 16:18:03 +0000
committerRoland McGrath <roland@gnu.org>1994-08-22 16:18:03 +0000
commit28b9ff7f43c80b56c0d26b5544ce0cdb889df6b2 (patch)
treeb252aa1722b7076b03101ca860db047b52eeacc9 /utils/shd.c
parenta24db6547d01a254f1c9b4f25c42542f4ae2008e (diff)
Formerly sh.c.~2~
Diffstat (limited to 'utils/shd.c')
-rw-r--r--utils/shd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils/shd.c b/utils/shd.c
index c85ff07d..9000b5aa 100644
--- a/utils/shd.c
+++ b/utils/shd.c
@@ -237,6 +237,16 @@ main ()
exec_init (getdport (0), getauth (),
MACH_PORT_NULL, MACH_MSG_TYPE_COPY_SEND);
+ {
+ int ttyd = open ("/dev/tty", O_RDWR|O_IGNORE_CTTY);
+ if (ttyd >= 0)
+ {
+ fcntl (ttyd, F_SETFD, FD_CLOEXEC);
+ stdin = fdopen (ttyd, "r");
+ stdout = stderr = fdopen (ttyd, "w");
+ }
+ }
+
atexit ((void (*) (void)) &sync);
while (1)