Commit 4359b5a9 by Christian Brauner Committed by GitHub

Merge pull request #1686 from 0x0916/2017-07-08/close-parent-end-after-fork

utils: close parent end in child process after fork
parents 996b20c4 6e670321
......@@ -490,6 +490,9 @@ extern struct lxc_popen_FILE *lxc_popen(const char *command)
/* child */
int child_std_end = STDOUT_FILENO;
close(parent_end);
parent_end = -1;
if (child_end != child_std_end) {
/* dup2() doesn't dup close-on-exec flag */
dup2(child_end, child_std_end);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment