mirror of
https://github.com/golang/go
synced 2024-10-04 15:09:59 +00:00
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>
This commit is contained in:
parent
11af353531
commit
cf4dc25503
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue