summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2010-03-11 11:09:58 +0000
committered <ed@FreeBSD.org>2010-03-11 11:09:58 +0000
commit6ed7df7af3873824148cb24454f5b3e046c99ae6 (patch)
tree8a0c7e7b35ac92d34c062caefd07c70c558e80a0
parent51eef24ef7da2a8dab637fb72ac5aa5595a4e697 (diff)
downloadFreeBSD-src-6ed7df7af3873824148cb24454f5b3e046c99ae6.zip
FreeBSD-src-6ed7df7af3873824148cb24454f5b3e046c99ae6.tar.gz
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
-rw-r--r--usr.bin/script/script.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c
index bd2de28..6b3d8cc 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;
OpenPOWER on IntegriCloud