mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
os: consistently return ErrClosed for closed file
Catch all the cases where a file operation might return ErrFileClosing, and convert to ErrClosed. Use a new method for the conversion, which permits us to remove some KeepAlive calls. Change-Id: I584178f297efe6cb86f3090b2341091b412f1041 Reviewed-on: https://go-review.googlesource.com/41793 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
502a03ffcf
commit
e3d7ec006f
6 changed files with 80 additions and 43 deletions
|
|
@ -186,6 +186,9 @@ func (file *file) close() error {
|
|||
}
|
||||
var err error
|
||||
if e := file.pfd.Close(); e != nil {
|
||||
if e == poll.ErrFileClosing {
|
||||
e = ErrClosed
|
||||
}
|
||||
err = &PathError{"close", file.name, e}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue