• Ian Lance Taylor's avatar
    os, runtime: better EPIPE behavior for command line programs · 58c73de7
    Ian Lance Taylor authored
    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/18151Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    58c73de7
signal1_unix.go 7.11 KB