summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Timmermans <fawaka@gmail.com>2018-12-16 01:05:06 +0100
committerLeon Timmermans <fawaka@gmail.com>2018-12-16 01:05:06 +0100
commit30c869b87739b56280daca3cd44b0588144747b7 (patch)
tree45eccc20b4577a32cc7895acc6332aedb0a8be59
parent0deccbc48080cbdd305d6c0c62702b49ee113ecc (diff)
downloadperl-30c869b87739b56280daca3cd44b0588144747b7.tar.gz
Always mark pipe in list pipe-open as inherit-on-exec
This is the my_popen_list counterpart of c6fe5b981b942ddabb23ed4b7602067e906e6d88
-rw-r--r--util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util.c b/util.c
index 99bf4ae2b0..8c9909e10c 100644
--- a/util.c
+++ b/util.c
@@ -2330,8 +2330,10 @@ Perl_my_popen_list(pTHX_ const char *mode, int n, SV **args)
if (p[THAT] != (*mode == 'r')) /* if dup2() didn't close it */
PerlLIO_close(p[THAT]); /* close parent's end of _the_ pipe */
}
- else
+ else {
+ setfd_cloexec_or_inhexec_by_sysfdness(p[THIS]);
PerlLIO_close(p[THAT]); /* close parent's end of _the_ pipe */
+ }
#if !defined(HAS_FCNTL) || !defined(F_SETFD)
/* No automatic close - do it by hand */
# ifndef NOFILE