mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 11:07:31 +01:00
16 lines
367 B
Go
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
|
|
}
|