CrazyMax b7ea25eb59
vendor: github.com/tonistiigi/fsutil 8d32dbdd27d3
full diff: 397af5306b...8d32dbdd27

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-11-06 12:02:13 +01:00

24 lines
364 B
Go

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