]> Cypherpunks repositories - gostls13.git/commit
runtime: handle SIGPIPE in c-archive and c-shared programs
authorElias Naur <elias.naur@gmail.com>
Sun, 6 Nov 2016 20:40:57 +0000 (21:40 +0100)
committerIan Lance Taylor <iant@golang.org>
Fri, 18 Nov 2016 01:19:11 +0000 (01:19 +0000)
commitd24b57a6a1a3530e590b7c0a72dc78043e198630
tree30bd1f9e3ea9cc3411defd8e7b0cb58895eae3db
parente54662dc859f65f90eefede76a6134f8d892cc77
runtime: handle SIGPIPE in c-archive and c-shared programs

Before this CL, Go programs in c-archive or c-shared buildmodes
would not handle SIGPIPE. That leads to surprising behaviour where
writes on a closed pipe or socket would raise SIGPIPE and terminate
the program. This CL changes the Go runtime to handle
SIGPIPE regardless of buildmode. In addition, SIGPIPE from non-Go
code is forwarded.

Fixes #17393
Updates #16760

Change-Id: I155e82020a03a5cdc627a147c27da395662c3fe8
Reviewed-on: https://go-review.googlesource.com/32796
Run-TryBot: Elias Naur <elias.naur@gmail.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/main2.c
misc/cgo/testcarchive/main3.c
misc/cgo/testcarchive/main5.c
misc/cgo/testcarchive/src/libgo2/libgo2.go
misc/cgo/testcarchive/src/libgo3/libgo3.go
src/os/signal/doc.go
src/runtime/signal_unix.go