1
0
mirror of https://github.com/golang/go synced 2024-11-14 15:10:54 -07:00
go/src/os
Ian Lance Taylor fb4b4342fe os, net, internal/poll: return consistent error for closed socket
In the past we returned "use of closed network connection" when using
a closed network descriptor in some way. In CL 36799 that was changed
to return "use of closed file or network connection". Because programs
have no access to a value of this error type (see issue #4373) they
resort to doing direct string comparisons (see issue #19252). This CL
restores the old error string so that we don't break programs
unnecessarily with the 1.9 release.

This adds a test to the net package for the expected string.

For symmetry check that the os package returns the expected error,
which for os already exists as os.ErrClosed.

Updates #4373.
Fixed #19252.

Change-Id: I5b83fd12cfa03501a077cad9336499b819f4a38b
Reviewed-on: https://go-review.googlesource.com/39997
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-04-26 00:03:14 +00:00
..
exec os/exec: Update Cmd.Run() docs to reflect correct error return types 2017-04-08 00:48:07 +00:00
signal
user os/user: fake Current on Android 2017-03-08 21:34:32 +00:00
dir_plan9.go
dir_unix.go os: use poller for file I/O 2017-02-15 19:31:55 +00:00
dir_windows.go os: fix race between file I/O and Close 2017-04-25 13:58:24 +00:00
dir.go
env_test.go
env_unix_test.go
env.go
error_plan9.go
error_posix.go os: use poller for file I/O 2017-02-15 19:31:55 +00:00
error_test.go
error_unix_test.go
error_unix.go
error_windows_test.go
error_windows.go
error.go
example_test.go os: add OpenFile example for appending data 2017-03-01 14:48:21 +00:00
exec_plan9.go
exec_posix.go
exec_unix.go
exec_windows.go os: parse command line without shell32.dll 2017-03-24 00:53:03 +00:00
exec.go
executable_darwin.go
executable_freebsd.go
executable_plan9.go
executable_procfs.go
executable_solaris.go
executable_test.go
executable_windows.go
executable.go
export_test.go
export_windows_test.go os: parse command line without shell32.dll 2017-03-24 00:53:03 +00:00
file_plan9.go os: use poller for file I/O 2017-02-15 19:31:55 +00:00
file_posix.go os: fix race between file I/O and Close 2017-04-25 13:58:24 +00:00
file_unix.go os, net, internal/poll: return consistent error for closed socket 2017-04-26 00:03:14 +00:00
file_windows.go os: fix race between file I/O and Close 2017-04-25 13:58:24 +00:00
file.go os, net, internal/poll: return consistent error for closed socket 2017-04-26 00:03:14 +00:00
getwd_darwin.go
getwd.go
os_test.go os: don't use a symlink's target path for FileInfo#Name on windows 2017-04-25 04:13:10 +00:00
os_unix_test.go
os_windows_test.go os: don't use a symlink's target path for FileInfo#Name on windows 2017-04-25 04:13:10 +00:00
path_plan9.go
path_test.go
path_unix.go
path_windows_test.go
path_windows.go
path.go
pipe_bsd.go syscall, os: use pipe2 syscall on FreeBSD instead of pipe 2017-03-21 20:01:23 +00:00
pipe_freebsd.go syscall, os: fix FreeBSD 9 build 2017-03-21 22:37:27 +00:00
pipe_linux.go os: use poller for file I/O 2017-02-15 19:31:55 +00:00
pipe_test.go os, net, internal/poll: return consistent error for closed socket 2017-04-26 00:03:14 +00:00
proc.go
stat_darwin.go
stat_dragonfly.go
stat_freebsd.go
stat_linux.go
stat_nacl.go
stat_netbsd.go
stat_openbsd.go
stat_plan9.go
stat_solaris.go
stat_unix.go os: use poller for file I/O 2017-02-15 19:31:55 +00:00
stat_windows.go os: fix race between file I/O and Close 2017-04-25 13:58:24 +00:00
sticky_bsd.go
sticky_notbsd.go
str.go
sys_bsd.go
sys_darwin.go os: remove incorrect detection of O_CLOEXEC flag on darwin 2017-02-18 16:14:15 +00:00
sys_freebsd.go
sys_linux.go
sys_nacl.go
sys_plan9.go
sys_solaris.go
sys_unix.go
sys_windows.go
sys.go
types_plan9.go
types_unix.go os: fix race between file I/O and Close 2017-04-25 13:58:24 +00:00
types_windows.go
types.go
wait_unimp.go os: don't use waitid on Darwin 2017-03-01 02:02:40 +00:00
wait_wait6.go
wait_waitid.go os: don't use waitid on Darwin 2017-03-01 02:02:40 +00:00