[core] skip excess close() when FD_CLOEXEC defined

do not run through close() loop after fork() and before execve()
when FD_CLOEXEC is defined
This commit is contained in:
Glenn Strauss 2020-02-25 23:43:13 -05:00
parent b28a3714c4
commit 95b2774863
1 changed files with 1 additions and 1 deletions

View File

@ -742,7 +742,7 @@ pid_t fdevent_fork_execve(const char *name, char *argv[], char *envp[], int fdin
if (0 != fdevent_set_stdin_stdout_stderr(fdin, fdout, fderr)) _exit(errno);
#ifndef FD_CLOEXEC
/*(might not be sufficient for open fds, but modern OS have FD_CLOEXEC)*/
for (int i = 3; i < 256; ++i) close(i);