mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 18:00:24 +08:00
15 lines
160 B
Go
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()))
|
||
|
}
|
||
|
}
|