containerd/content/store_unix.go
Kevin Swiber b365fbecfd Ensure proper types for arguments to time.Unix.
When compiling for armv7, the type is `int32` for `Timespec.Sec` and
`Timespec.Nsec` in the syscall package. When passing these values
to `time.Unix`, the values must be converted to `int64`.

Signed-off-by: Kevin Swiber <kswiber@gmail.com>
2017-04-20 12:55:06 -07:00

18 lines
251 B
Go

// +build linux
package content
import (
"os"
"syscall"
"time"
)
func getStartTime(fi os.FileInfo) time.Time {
if st, ok := fi.Sys().(*syscall.Stat_t); ok {
return time.Unix(int64(st.Ctim.Sec), int64(st.Ctim.Nsec))
}
return fi.ModTime()
}