From ce1fb5a1c9bdedc33ab648c5a426540216cf0958 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Tue, 17 Jun 2014 23:19:42 +0000 Subject: [PATCH] allow utimes on mac os, only lutimes isn't supported Docker-DCO-1.1-Signed-off-by: Victor Vieux (github: vieux) --- system/utimes_darwin.go | 11 +++++++++++ system/utimes_linux.go | 5 +---- system/utimes_unsupported.go | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 system/utimes_darwin.go diff --git a/system/utimes_darwin.go b/system/utimes_darwin.go new file mode 100644 index 0000000..4c6002f --- /dev/null +++ b/system/utimes_darwin.go @@ -0,0 +1,11 @@ +package system + +import "syscall" + +func LUtimesNano(path string, ts []syscall.Timespec) error { + return ErrNotSupportedPlatform +} + +func UtimesNano(path string, ts []syscall.Timespec) error { + return syscall.UtimesNano(path, ts) +} diff --git a/system/utimes_linux.go b/system/utimes_linux.go index c00f402..8f90298 100644 --- a/system/utimes_linux.go +++ b/system/utimes_linux.go @@ -24,8 +24,5 @@ func LUtimesNano(path string, ts []syscall.Timespec) error { } func UtimesNano(path string, ts []syscall.Timespec) error { - if err := syscall.UtimesNano(path, ts); err != nil { - return err - } - return nil + return syscall.UtimesNano(path, ts) } diff --git a/system/utimes_unsupported.go b/system/utimes_unsupported.go index 9a8cf9c..adf2734 100644 --- a/system/utimes_unsupported.go +++ b/system/utimes_unsupported.go @@ -1,4 +1,4 @@ -// +build !linux,!freebsd +// +build !linux,!freebsd,!darwin package system