mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-25 13:17:45 +08:00

Update modules: go mod edit -require github.com/moby/buildkit@master go mod tidy -compat=1.17 && ./hack/update-vendor Signed-off-by: Justin Chadwell <me@jedevc.com>
22 lines
423 B
Go
22 lines
423 B
Go
//go:build linux
|
|
// +build linux
|
|
|
|
package fsutil
|
|
|
|
import (
|
|
"github.com/pkg/errors"
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func chtimes(path string, un int64) error {
|
|
var utimes [2]unix.Timespec
|
|
utimes[0] = unix.NsecToTimespec(un)
|
|
utimes[1] = utimes[0]
|
|
|
|
if err := unix.UtimesNanoAt(unix.AT_FDCWD, path, utimes[0:], unix.AT_SYMLINK_NOFOLLOW); err != nil {
|
|
return errors.Wrap(err, "failed call to UtimesNanoAt")
|
|
}
|
|
|
|
return nil
|
|
}
|