You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-zero/core/fs/files.go

15 lines
160 B
Go

4 years ago
// +build linux darwin
package fs
import (
"os"
"syscall"
)
func CloseOnExec(file *os.File) {
if file != nil {
syscall.CloseOnExec(int(file.Fd()))
}
}