From 28b9ff7f43c80b56c0d26b5544ce0cdb889df6b2 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 22 Aug 1994 16:18:03 +0000 Subject: Formerly sh.c.~2~ --- utils/shd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) -- cgit v1.2.3