From 70804dd20fa23c3156f47b03ec030d7047309c0c Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sat, 17 Oct 2020 15:45:14 -0600 Subject: [PATCH] Remoe stat_arm.go, make stat_linux.go with with both 32 and 64 bit systems --- server/filesystem/stat_arm.go | 13 ------------- server/filesystem/stat_linux.go | 5 ++--- 2 files changed, 2 insertions(+), 16 deletions(-) delete mode 100644 server/filesystem/stat_arm.go diff --git a/server/filesystem/stat_arm.go b/server/filesystem/stat_arm.go deleted file mode 100644 index 21e75e3..0000000 --- a/server/filesystem/stat_arm.go +++ /dev/null @@ -1,13 +0,0 @@ -package filesystem - -import ( - "syscall" - "time" -) - -// Returns the time that the file/folder was created. -func (s *Stat) CTime() time.Time { - st := s.Info.Sys().(*syscall.Stat_t) - - return time.Unix(int64(st.Ctim.Sec), int64(st.Ctim.Nsec)) -} diff --git a/server/filesystem/stat_linux.go b/server/filesystem/stat_linux.go index 1ee4514..e166740 100644 --- a/server/filesystem/stat_linux.go +++ b/server/filesystem/stat_linux.go @@ -1,5 +1,3 @@ -// +build !arm - package filesystem import ( @@ -11,5 +9,6 @@ import ( func (s *Stat) CTime() time.Time { st := s.Info.Sys().(*syscall.Stat_t) - return time.Unix(st.Ctim.Sec, st.Ctim.Nsec) + // Do not remove these "redundant" type-casts, they are required for 32-bit builds to work. + return time.Unix(int64(st.Ctim.Sec), int64(st.Ctim.Nsec)) }