1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Assume that O_CLOEXEC is always defined and works

This commit is contained in:
Florian Weimer
2017-04-18 14:56:51 +02:00
parent b48061e1a5
commit cef9b65376
27 changed files with 91 additions and 565 deletions

View File

@ -173,12 +173,10 @@ _IO_new_proc_open (_IO_FILE *fp, const char *command, const char *mode)
if (child_end != child_std_end)
_IO_dup2 (child_end, child_std_end);
#ifdef O_CLOEXEC
else
/* The descriptor is already the one we will use. But it must
not be marked close-on-exec. Undo the effects. */
__fcntl (child_end, F_SETFD, 0);
#endif
/* POSIX.2: "popen() shall ensure that any streams from previous
popen() calls that remain open in the parent process are closed
in the new child process." */