-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os: File.Readdir may return nil fileinfo #5960
Labels
Milestone
Comments
https://code.google.com/p/go/source/browse/src/pkg/os/file_unix.go#152 line 162: if err == nil { err is always nil, because it was set on line 158 by Readdirnames, which did not fail. I'm pretty sure this should be: line 162: if lerr == nil { I've been trying to think of a test for this, but it depends on constructing a situation where Readdirnames() returns a name that Lstat can't touch. Playing with permissions doesn't work (at least not on linux), so maybe filling a directory with a million files, and start Readdir() while another goroutine starts removing files. I'll make a CL tonight. |
https://golang.org/cl/12261043/ No test, I just can't make Lstat() fail after Readdirnames() didn't. |
This issue was closed by revision bdbd541. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: