1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/vendor/github.com/tonistiigi/fsutil/chtimes_nolinux.go
Tonis Tiigi 6fcb36ff14 vendor: add buildkit dependency
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-10 10:05:19 -07:00

20 lines
284 B
Go

// +build !linux
package fsutil
import (
"os"
"time"
)
func chtimes(path string, un int64) error {
mtime := time.Unix(0, un)
fi, err := os.Lstat(path)
if err != nil {
return err
}
if fi.Mode()&os.ModeSymlink != 0 {
return nil
}
return os.Chtimes(path, mtime, mtime)
}