mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
os: return a *PathError from Readdirnames and Readdir on POSIX platforms
Previously, Readdirnames returned a *PathError on Windows and Plan 9, but a *SyscallError on POSIX systems. In contrast, similar methods (such as Stat) return a *PathError on all platforms. Fixes #38923 Change-Id: I26395905b1e723933f07b792c7aeee7c335949cd Reviewed-on: https://go-review.googlesource.com/c/go/+/233917 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
c78d215ce3
commit
b3d9cf7a07
3 changed files with 10 additions and 6 deletions
|
|
@ -50,7 +50,7 @@ func (f *File) readdirnames(n int) (names []string, err error) {
|
|||
d.nbuf, errno = f.pfd.ReadDirent(d.buf)
|
||||
runtime.KeepAlive(f)
|
||||
if errno != nil {
|
||||
return names, wrapSyscallError("readdirent", errno)
|
||||
return names, &PathError{"readdirent", f.name, errno}
|
||||
}
|
||||
if d.nbuf <= 0 {
|
||||
break // EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue