Commit 792854237a for golang
commit 792854237a616b214044f383ba7c6de98cecd1c6
Author: Sebastien Tardif <SebTardif@ncf.ca>
Date: Mon Nov 30 23:17:19 2026 +0000
os: retry EINTR in Chtimes
Chtimes returned EINTR from utimensat. chmod and Root.Chtimes
already retry that error through ignoringEINTR.
Fixes #83530
Change-Id: I3e61606b28951bc28d713a36e4e798a5f164baed
GitHub-Last-Rev: 081e47bee1948fd5e6d2d9fffd1d09b4e4ccc028
GitHub-Pull-Request: golang/go#83531
Reviewed-on: https://go-review.googlesource.com/c/go/+/868482
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
diff --git a/src/os/file_posix.go b/src/os/file_posix.go
index 12fc523f84..506ea1d81d 100644
--- a/src/os/file_posix.go
+++ b/src/os/file_posix.go
@@ -179,7 +179,10 @@ func (f *File) Sync() error {
// If there is an error, it will be of type [*PathError].
func Chtimes(name string, atime time.Time, mtime time.Time) error {
utimes := chtimesUtimes(atime, mtime)
- if e := syscall.UtimesNano(fixLongPath(name), utimes[0:]); e != nil {
+ e := ignoringEINTR(func() error {
+ return syscall.UtimesNano(fixLongPath(name), utimes[0:])
+ })
+ if e != nil {
return &PathError{Op: "chtimes", Path: name, Err: e}
}
return nil