init: 1.0.0
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
//go:build linux || darwin
|
||||
|
||||
package fs
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// CloseOnExec makes sure closing the file on process forking.
|
||||
func CloseOnExec(file *os.File) {
|
||||
if file != nil {
|
||||
syscall.CloseOnExec(int(file.Fd()))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user