Commit 674cd032 authored by Jeff's avatar Jeff Committed by Han-Wen Nienhuys

Fix files_linux.go to work on 386

Because Timeval has an int32 field on 386, use syscall.NsecToTimeval to build the Timeval in a cross-arch way.
parent 94bf1c34
......@@ -24,16 +24,14 @@ func (f *loopbackFile) Utimens(a *time.Time, m *time.Time) Status {
tv[0].Usec = _UTIME_OMIT
} else {
n := a.UnixNano()
tv[0].Sec = n / 1e9
tv[0].Usec = (n % 1e9) / 1e3
tv[0] = syscall.NsecToTimeval(n)
}
if m == nil {
tv[1].Usec = _UTIME_OMIT
} else {
n := a.UnixNano()
tv[1].Sec = n / 1e9
tv[1].Usec = (n % 1e9) / 1e3
tv[1] = syscall.NsecToTimeval(n)
}
err := syscall.Futimes(int(f.File.Fd()), tv)
......
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