summary refs log tree commit diff
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2018-11-07 14:04:52 +0100
committerPeter Stephenson <p.stephenson@samsung.com>2018-11-09 10:54:47 +0000
commita8cc017c74a916b690dc074c299faf4bd24b5af4 (patch)
tree59979eb64d3872fedb97931e849507bca5fc89c3
parentfc3826190a6480d8e45e05e22ca64c548e79e36a (diff)
downloadzsh-a8cc017c74a916b690dc074c299faf4bd24b5af4.tar.gz
zsh-a8cc017c74a916b690dc074c299faf4bd24b5af4.tar.xz
zsh-a8cc017c74a916b690dc074c299faf4bd24b5af4.zip
43791: File descriptor could be closed twice in clone
-rw-r--r--ChangeLog4
-rw-r--r--Src/Modules/clone.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 72a74849e..97751c16e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-11-09  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* 43791: Kamil: Src/Modules/clone.c: file descriptor was closed twice.
+
 2018-11-08  Oliver Kiddle  <okiddle@yahoo.co.uk>
 
 	* 43779 (tweaked): Joey Pabalinas: Functions/Zle/select-bracketed: 
diff --git a/Src/Modules/clone.c b/Src/Modules/clone.c
index ef6275dcf..4b2655505 100644
--- a/Src/Modules/clone.c
+++ b/Src/Modules/clone.c
@@ -96,7 +96,8 @@ bin_clone(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 	init_io(NULL);
 	setsparam("TTY", ztrdup(ttystrname));
     }
-    close(ttyfd);
+    else
+	close(ttyfd);
     if (pid < 0) {
 	zerrnam(nam, "fork failed: %e", errno);
 	return 1;