aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/io.c b/io.c
index 18ad765d85..b9a84e11e4 100644
--- a/io.c
+++ b/io.c
@@ -3040,6 +3040,9 @@ popen_exec(void *pp)
popen_redirect(p);
for (fd = 3; fd < NOFILE; fd++) {
+#ifdef FD_CLOEXEC
+ if (fcntl(fd, F_GETFD) & FD_CLOEXEC) continue;
+#endif
close(fd);
}
return rb_exec(&p->exec);