]> Cypherpunks repositories - gostls13.git/commit
os, runtime: better EPIPE behavior for command line programs
authorIan Lance Taylor <iant@golang.org>
Mon, 28 Dec 2015 19:29:22 +0000 (11:29 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 5 Jan 2016 00:32:50 +0000 (00:32 +0000)
commit58c73de7d09ca750f5d1927448f086ee25977dad
treefa1acd7c3b39add1ad8d102116b131c558b75a58
parenta7d2b4d7cef3bf3107c6cf9725cd1c6151cf18d4
os, runtime: better EPIPE behavior for command line programs

Old behavior: 10 consecutive EPIPE errors on any descriptor cause the
program to exit with a SIGPIPE signal.

New behavior: an EPIPE error on file descriptors 1 or 2 cause the
program to raise a SIGPIPE signal.  If os/signal.Notify was not used to
catch SIGPIPE signals, this will cause the program to exit with SIGPIPE.
An EPIPE error on a file descriptor other than 1 or 2 will simply be
returned from Write.

Fixes #11845.
Update #9896.

Change-Id: Ic85d77e386a8bb0255dc4be1e4b3f55875d10f18
Reviewed-on: https://go-review.googlesource.com/18151
Reviewed-by: Russ Cox <rsc@golang.org>
src/os/file_unix.go
src/os/pipe_test.go [new file with mode: 0644]
src/os/signal/doc.go
src/runtime/signal1_unix.go