go-zero/core/fs/files.go
2020-07-26 17:09:05 +08:00

15 lines
160 B
Go

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