diff options
| author | Ian Lance Taylor <iant@golang.org> | 2019-02-12 10:20:28 -0800 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2019-02-12 21:17:38 +0000 |
| commit | cf4dc25503e6fb630280f8de0f11112aecb94b57 (patch) | |
| tree | 71e5acb5bb225a7a73f61f9d69ccb15b6229c1f8 /src | |
| parent | 11af3535310ed1f92cb75f523082702988bbd7f6 (diff) | |
| download | go-cf4dc25503e6fb630280f8de0f11112aecb94b57.tar.xz | |
os: don't return ENOENT if directory removed before Fstatat
Fixes #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>
Diffstat (limited to 'src')
| -rw-r--r-- | src/os/removeall_at.go | 3 |
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 { |
