libdill
libdill copied to clipboard
Set close-on-exec flagas to avoid FD leaks to subprocesses
Description
These fixes prevent file descriptor leaks in my application. There may still be other potential leak sources in functions that my application does not use.
I tried to implement accept() using accept4() if it is available since that avoids a potential race condition. Same with fcntl(n,F_DUPFD_CLOEXEC,0) instead of dup().