Commit dd7ef76b authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fs: avoid using unix.UTIME_OMIT on darwin

Change-Id: I8f05010f64edaf1d41fdfca31ee4ae3079cd0ae3
parent 087d70b7
......@@ -403,8 +403,8 @@ func (n *LoopbackNode) Setattr(ctx context.Context, f FileHandle, in *fuse.SetAt
atime, aok := in.GetATime()
if mok || aok {
ta := unix.Timespec{Nsec: unix.UTIME_OMIT}
tm := unix.Timespec{Nsec: unix.UTIME_OMIT}
ta := unix.Timespec{Nsec: unix_UTIME_OMIT}
tm := unix.Timespec{Nsec: unix_UTIME_OMIT}
var err error
if aok {
ta, err = unix.TimeToTimespec(atime)
......
......@@ -12,6 +12,8 @@ import (
"time"
)
const unix_UTIME_OMIT = 0x0
// timeToTimeval - Convert time.Time to syscall.Timeval
//
// Note: This does not use syscall.NsecToTimespec because
......
......@@ -7,6 +7,8 @@ import (
"golang.org/x/sys/unix"
)
const unix_UTIME_OMIT = unix.UTIME_OMIT
// FreeBSD has added copy_file_range(2) since FreeBSD 12. However,
// golang.org/x/sys/unix hasn't add corresponding syscall constant or
// wrap function. Here we define the syscall constant until sys/unix
......
......@@ -13,6 +13,8 @@ import (
"golang.org/x/sys/unix"
)
const unix_UTIME_OMIT = unix.UTIME_OMIT
func doCopyFileRange(fdIn int, offIn int64, fdOut int, offOut int64,
len int, flags int) (uint32, syscall.Errno) {
count, err := unix.CopyFileRange(fdIn, &offIn, fdOut, &offOut, len, flags)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment