aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-02-12 10:20:28 -0800
committerIan Lance Taylor <iant@golang.org>2019-02-13 23:50:05 +0000
commitfa5e4baf876d000051a2b606356a688250e2ba6e (patch)
treef885956a9f53959141fd8ffef5176ccb3f2eb125
parent0cfe46ce7430b1b14d31d0ab0dd02d14b0472143 (diff)
downloadgo-fa5e4baf876d000051a2b606356a688250e2ba6e.tar.gz
go-fa5e4baf876d000051a2b606356a688250e2ba6e.zip
[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: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit cf4dc25503e6fb630280f8de0f11112aecb94b57) Reviewed-on: https://go-review.googlesource.com/c/162197
-rw-r--r--src/os/removeall_at.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/os/removeall_at.go b/src/os/removeall_at.go
index 7f2d5922ae..0b7d5efb7a 100644
--- a/src/os/removeall_at.go
+++ b/src/os/removeall_at.go
@@ -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 {