
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>
18 lines
251 B
Go
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()
|
|
}
|