aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Savoye <rob.savoye@linaro.org>2016-03-01 09:58:33 +0700
committerRob Savoye <rob.savoye@linaro.org>2016-03-01 09:58:33 +0700
commit38811e19780ceee8b7e3b81cf218e96b1bc01d4c (patch)
tree76aad9a2d3ff0acc9dd75c742133c2bb6647d9a4
parentd09768aafd37c261b9150a8b9150843aa0b93018 (diff)
Fix leaking file descriptors, reference https://bugzilla.redhat.com/show_bug.cgi?id=1001220HEADmaster
-rw-r--r--exp_command.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/exp_command.c b/exp_command.c
index b554b18..c055ffd 100644
--- a/exp_command.c
+++ b/exp_command.c
@@ -1161,7 +1161,7 @@ Exp_SpawnObjCmd(
/* if stty finds dev(stderr) != dev(stdout) */
/* save error fd while we're setting up new one */
- errorfd = fcntl(2,F_DUPFD,3);
+ errorfd = fcntl(2,F_DUPFD_CLOEXEC,3);
/* and here is the macro to restore it */
#define restore_error_fd {close(2);fcntl(errorfd,F_DUPFD,2);}