From fa5e4baf876d000051a2b606356a688250e2ba6e Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 12 Feb 2019 10:20:28 -0800 Subject: [PATCH] [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 TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick (cherry picked from commit cf4dc25503e6fb630280f8de0f11112aecb94b57) Reviewed-on: https://go-review.googlesource.com/c/162197 --- src/os/removeall_at.go | 3 +++ 1 file changed, 3 insertions(+) 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 { -- 2.48.1