]> Cypherpunks repositories - gostls13.git/commit
runtime: don't forward SIGPIPE on macOS
authorElias Naur <mail@eliasnaur.com>
Wed, 31 Jul 2019 12:33:57 +0000 (14:33 +0200)
committerElias Naur <mail@eliasnaur.com>
Sat, 31 Aug 2019 06:19:40 +0000 (06:19 +0000)
commit2afe9d4dece86f523dc9e75696bffa158dcbd976
tree92b2d14186f05b410f308acc28ddd1ca4e5c0a40
parent9f85668a6528aa77a377aa39ba0d83e76301efcc
runtime: don't forward SIGPIPE on macOS

macOS and iOS deliver SIGPIPE signals to the main thread and not
the thread that raised it by writing to a closed socket or pipe.

SIGPIPE signals can be suppressed for sockets with the SO_NOSIGPIPE
option, but there is no similar option for pipes. We have no other
choice but to never forward SIGPIPE on macOS.

This is a fixup of reverted CL 188297.

Fixes #33384

Change-Id: I09b258b078857ad3b22025bc2902d1b12d2afd92
Reviewed-on: https://go-review.googlesource.com/c/go/+/191785
Run-TryBot: Elias Naur <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
misc/cgo/testcarchive/carchive_test.go
misc/cgo/testcarchive/testdata/main2.c
misc/cgo/testcarchive/testdata/main3.c
src/runtime/signal_unix.go