Files
seaweedfs/seaweed-block/cmd/sw-block/log_collect_open_linux.go
T

16 lines
367 B
Go

package main
import (
"golang.org/x/sys/unix"
"os"
)
// A renamed FIFO cannot block acquisition; a substituted link is never followed.
func openBundleLog(path string) (*os.File, error) {
fd, err := unix.Open(path, unix.O_RDONLY|unix.O_CLOEXEC|unix.O_NOFOLLOW|unix.O_NONBLOCK, 0)
if err != nil {
return nil, err
}
return os.NewFile(uintptr(fd), path), nil
}