Fix assignment error in Unix2syscall by converting Timespec into Nsec (#203)

$ go.gcc build
# github.com/rfjakob/gocryptfs/internal/syscallcompat
internal/syscallcompat/unix2syscall_linux.go:32:13: error: incompatible types in assignment (cannot use type int64 as type syscall.Timespec_sec_t)
  s.Atim.Sec = u.Atim.Sec
             ^
libgocryptfs
Felix Lechner 5 years ago committed by rfjakob
parent 866e850842
commit 5b986288cf
  1. 6
      internal/syscallcompat/unix2syscall_linux.go

@ -21,8 +21,8 @@ func Unix2syscall(u unix.Stat_t) syscall.Stat_t {
Size: u.Size,
Blksize: u.Blksize,
Blocks: u.Blocks,
Atim: syscall.Timespec(u.Atim),
Mtim: syscall.Timespec(u.Mtim),
Ctim: syscall.Timespec(u.Ctim),
Atim: syscall.NsecToTimespec(unix.TimespecToNsec(u.Atim)),
Mtim: syscall.NsecToTimespec(unix.TimespecToNsec(u.Mtim)),
Ctim: syscall.NsecToTimespec(unix.TimespecToNsec(u.Ctim)),
}
}

Loading…
Cancel
Save