Use CLOEXEC with openat
This commit is contained in:
parent
43035b7224
commit
b4f7162a73
1 changed files with 1 additions and 1 deletions
|
|
@ -48,7 +48,7 @@ func openAt(dirFile *os.File, name string, flags int, perm os.FileMode) (*os.Fil
|
|||
dirFd := int(dirFile.Fd())
|
||||
|
||||
// Call the underlying system call
|
||||
fd, err := unix.Openat(dirFd, name, flags, uint32(perm))
|
||||
fd, err := unix.Openat(dirFd, name, flags|unix.O_CLOEXEC, uint32(perm))
|
||||
if err != nil {
|
||||
return nil, &os.PathError{Op: "openat", Path: name, Err: err}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue