From e3f454a2c932de08b34a6b1dde721e5e81faf1cc Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 22 Feb 2016 14:33:27 +1100 Subject: [PATCH] Fix build on several OS by observing that Stat access times are split into 2 camps, Atim, and Atimespec Doesn't work for plan9. http://stackoverflow.com/questions/35545178/where-is-stat-t-defined-for-plan9 --- atime_linux.go => atime_atim.go | 2 ++ atime_darwin.go => atime_atimespec.go | 2 ++ atime_freebsd.go | 12 ------------ atime_netbsd.go | 12 ------------ 4 files changed, 4 insertions(+), 24 deletions(-) rename atime_linux.go => atime_atim.go (82%) rename atime_darwin.go => atime_atimespec.go (86%) delete mode 100644 atime_freebsd.go delete mode 100644 atime_netbsd.go diff --git a/atime_linux.go b/atime_atim.go similarity index 82% rename from atime_linux.go rename to atime_atim.go index e599d8b..947edda 100644 --- a/atime_linux.go +++ b/atime_atim.go @@ -1,3 +1,5 @@ +// +build linux dragonfly openbsd solaris + package missinggo import ( diff --git a/atime_darwin.go b/atime_atimespec.go similarity index 86% rename from atime_darwin.go rename to atime_atimespec.go index 5ccbc43..d7c14dc 100644 --- a/atime_darwin.go +++ b/atime_atimespec.go @@ -1,3 +1,5 @@ +// +build darwin freebsd netbsd + package missinggo import ( diff --git a/atime_freebsd.go b/atime_freebsd.go deleted file mode 100644 index 5ccbc43..0000000 --- a/atime_freebsd.go +++ /dev/null @@ -1,12 +0,0 @@ -package missinggo - -import ( - "os" - "syscall" - "time" -) - -func fileInfoAccessTime(fi os.FileInfo) time.Time { - ts := fi.Sys().(*syscall.Stat_t).Atimespec - return time.Unix(int64(ts.Sec), int64(ts.Nsec)) -} diff --git a/atime_netbsd.go b/atime_netbsd.go deleted file mode 100644 index 5ccbc43..0000000 --- a/atime_netbsd.go +++ /dev/null @@ -1,12 +0,0 @@ -package missinggo - -import ( - "os" - "syscall" - "time" -) - -func fileInfoAccessTime(fi os.FileInfo) time.Time { - ts := fi.Sys().(*syscall.Stat_t).Atimespec - return time.Unix(int64(ts.Sec), int64(ts.Nsec)) -}