Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add SOCK_CLOEXEC to socket creation
Go runtime automatically adds this flag, but when using raw syscalls, it should be added manually. Without this flag, the process leaks a file descriptor on fork/exec. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
- Loading branch information
4d51994
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change breaks the build for Darwin MacOSX, for which the architecture dependent files zerrors_xxx_xxx.go in golang.org/x/sys/unix do not include unix.SOCK_CLOEXEC
4d51994
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This library is linux dependent. It is not intended to work on MacOSX.