]> Cypherpunks repositories - gostls13.git/commit
runtime: fix running under nohup
authorRuss Cox <rsc@golang.org>
Fri, 15 Feb 2013 16:18:55 +0000 (11:18 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 15 Feb 2013 16:18:55 +0000 (11:18 -0500)
commitf3407f445d51dac3b9415cb5025ac98ccbbc80eb
tree98c136267db30a124781f60f0d4a7a3014fc84a9
parent5b20a18f3b985cdf116a0ea6dd589d26056b16ad
runtime: fix running under nohup

There are two ways nohup(1) might be implemented:
it might mask away the signal, or it might set the handler
to SIG_IGN, both of which are inherited across fork+exec.
So two fixes:

* Make sure to preserve the inherited signal mask at
minit instead of clearing it.

* If the SIGHUP handler is SIG_IGN, leave it that way.

Fixes #4491.

R=golang-dev, mikioh.mikioh, iant
CC=golang-dev
https://golang.org/cl/7308102
24 files changed:
src/pkg/runtime/os_darwin.h
src/pkg/runtime/os_freebsd.h
src/pkg/runtime/os_linux.h
src/pkg/runtime/os_netbsd.h
src/pkg/runtime/os_openbsd.h
src/pkg/runtime/runtime.h
src/pkg/runtime/signal_darwin_386.c
src/pkg/runtime/signal_darwin_amd64.c
src/pkg/runtime/signal_freebsd_386.c
src/pkg/runtime/signal_freebsd_amd64.c
src/pkg/runtime/signal_freebsd_arm.c
src/pkg/runtime/signal_linux_386.c
src/pkg/runtime/signal_linux_amd64.c
src/pkg/runtime/signal_linux_arm.c
src/pkg/runtime/signal_netbsd_386.c
src/pkg/runtime/signal_netbsd_amd64.c
src/pkg/runtime/signal_netbsd_arm.c
src/pkg/runtime/signal_openbsd_386.c
src/pkg/runtime/signal_openbsd_amd64.c
src/pkg/runtime/thread_darwin.c
src/pkg/runtime/thread_freebsd.c
src/pkg/runtime/thread_linux.c
src/pkg/runtime/thread_netbsd.c
src/pkg/runtime/thread_openbsd.c