files.go 160 B

1234567891011121314
  1. // +build linux darwin
  2. package fs
  3. import (
  4. "os"
  5. "syscall"
  6. )
  7. func CloseOnExec(file *os.File) {
  8. if file != nil {
  9. syscall.CloseOnExec(int(file.Fd()))
  10. }
  11. }