aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-11-09 12:07:06 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-11-09 12:07:06 +0000
commit7e94af39f99027d2b3c4b2c3d8e902a79c264db3 (patch)
tree9edbe29a4f48c26a197d073aad4688c98fc66a82 /libgo
parent18700cbbfa7b2c0a8a21947b01fae1748bbdcae2 (diff)
Merge branches/gcc-7-branch rev 265943.
Change-Id: I26d1099385c6c64150e153f8f6f304d161b5dac1
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/os/wait_waitid.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/libgo/go/os/wait_waitid.go b/libgo/go/os/wait_waitid.go
index 3337395510e..6eb487b11af 100644
--- a/libgo/go/os/wait_waitid.go
+++ b/libgo/go/os/wait_waitid.go
@@ -25,9 +25,12 @@ func (p *Process) blockUntilWaitable() (bool, error) {
// We don't care about the values it returns.
var siginfo [16]uint64
psig := &siginfo[0]
- _, _, e := syscall.Syscall6(syscall.SYS_WAITID, _P_PID, uintptr(p.Pid), uintptr(unsafe.Pointer(psig)), syscall.WEXITED|syscall.WNOWAIT, 0, 0)
+ r, _, e := syscall.Syscall6(syscall.SYS_WAITID, _P_PID, uintptr(p.Pid), uintptr(unsafe.Pointer(psig)), syscall.WEXITED|syscall.WNOWAIT, 0, 0)
runtime.KeepAlive(p)
- if e != 0 {
+ // Check r as well as e because syscall.Syscall6 currently
+ // just returns errno, and the SIGCHLD signal handler may
+ // change errno. See https://gcc.gnu.org/PR86331.
+ if r != 0 && e != 0 {
// waitid has been available since Linux 2.6.9, but
// reportedly is not available in Ubuntu on Windows.
// See issue 16610.