]> Cypherpunks repositories - gostls13.git/commit
internal/poll: make FD.isFile mean whether it isn't socket on Windows
authorWèi Cōngruì <crvv.mail@gmail.com>
Wed, 6 Mar 2019 08:43:27 +0000 (08:43 +0000)
committerIan Lance Taylor <iant@golang.org>
Wed, 6 Mar 2019 18:04:33 +0000 (18:04 +0000)
commita60b56adbeb80bb8b05b88ae89ac832c69ec5995
tree5e96aa318949a178515a93bd13fa819a5341e7a1
parent029a5af6a1f517a0863ad6067e50e6040663c416
internal/poll: make FD.isFile mean whether it isn't socket on Windows

Before this change, if a directory was closed twice on Windows,
the returning error would be "use of closed network connection".

Some code assumes FD.isFile means whether the fd isn't a network
socket, which is true on Unix. But isFile reports whether
the fd is a normal file rather than directory or console on Windows.

With this change, isFile will have the same meaning on different
platforms. And the change adds a new field kind to replace isConsole
and isDir.

Change-Id: Ib12265f1e12fa3d0239ae925291128a84be59cc2
GitHub-Last-Rev: 3f031756de6ce0b96c1f102ad280950f4adbf6c2
GitHub-Pull-Request: golang/go#30589
Reviewed-on: https://go-review.googlesource.com/c/go/+/165257
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/internal/poll/fd_windows.go
src/os/os_test.go