Commit fa5e4baf authored by Ian Lance Taylor's avatar Ian Lance Taylor

[release-branch.go1.12] os: don't return ENOENT if directory removed before Fstatat

Updates #30197

Change-Id: I08b592fbd477d6879eb5d3b7fcbbc8322ea90103
Reviewed-on: https://go-review.googlesource.com/c/162078
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit cf4dc255)
Reviewed-on: https://go-review.googlesource.com/c/162197
parent 0cfe46ce
......@@ -71,6 +71,9 @@ func removeAllFrom(parent *File, path string) error {
var statInfo syscall.Stat_t
statErr := unix.Fstatat(parentFd, path, &statInfo, unix.AT_SYMLINK_NOFOLLOW)
if statErr != nil {
if IsNotExist(statErr) {
return nil
}
return statErr
}
if statInfo.Mode&syscall.S_IFMT != syscall.S_IFDIR {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment