From 8d5e4a1416a17965273ceb8acfb5ef649dfc2acf Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Thu, 11 Mar 2010 11:09:58 +0000 Subject: [PATCH] Make script(1) a little less broken. Close the file descriptor to the TTY. There is no reason why the parent process should keep track of the descriptor. This ensures that the application inside properly drains the TTY during exit(2). Reported by: alfred MFC after: 2 weeks --- usr.bin/script/script.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index bd2de283ebf8..6b3d8cc2f15b 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -158,6 +158,8 @@ main(int argc, char *argv[]) } if (child == 0) doshell(argv); + else + close(slave); if (flushtime > 0) tvp = &tv;