about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2013-07-20 23:23:18 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2013-07-20 23:23:18 +0100
commit39ab9952e8255cb99e9c0abcc8bbec43158a55d7 (patch)
tree66f73559ea86998c8ac97684029aca20308c5721 /Src/exec.c
parent9a192dddd277b2bf94785c9d13f3bfeb41715cf2 (diff)
downloadzsh-39ab9952e8255cb99e9c0abcc8bbec43158a55d7.tar.gz
zsh-39ab9952e8255cb99e9c0abcc8bbec43158a55d7.tar.xz
zsh-39ab9952e8255cb99e9c0abcc8bbec43158a55d7.zip
31545: Use of FD_CLOEXEC to remove possibility of fd reuse.
File descriptors of mmap'd dump files are closed if and only if
an exec is performed.
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Src/exec.c b/Src/exec.c
index d462d97c6..f9efb3a19 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -448,7 +448,9 @@ zexecve(char *pth, char **argv, char **newenvp)
     else
 	sprintf(buf + 2, "%s/%s", pwd, pth);
     zputenv(buf);
+#ifndef FD_CLOEXEC
     closedumps();
+#endif
 
     if (newenvp == NULL)
 	    newenvp = environ;