diff options
-rw-r--r-- | utils/shd.c | 10 |
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) |