Skip to content

Commit fa5e4ba

Browse files
[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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> (cherry picked from commit cf4dc25) Reviewed-on: https://go-review.googlesource.com/c/162197
1 parent 0cfe46c commit fa5e4ba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/os/removeall_at.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ func removeAllFrom(parent *File, path string) error {
7171
var statInfo syscall.Stat_t
7272
statErr := unix.Fstatat(parentFd, path, &statInfo, unix.AT_SYMLINK_NOFOLLOW)
7373
if statErr != nil {
74+
if IsNotExist(statErr) {
75+
return nil
76+
}
7477
return statErr
7578
}
7679
if statInfo.Mode&syscall.S_IFMT != syscall.S_IFDIR {

0 commit comments

Comments
 (0)