diff options
| author | Russ Cox <rsc@golang.org> | 2013-02-15 12:18:33 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2013-02-15 12:18:33 -0500 |
| commit | c7f7bbbf03415e1805e503846627f2e08423c360 (patch) | |
| tree | 8ef2e49d555a6febdccda01d89df9123b929e742 /src/pkg/runtime/thread_linux.c | |
| parent | f8f2727ab50decb8db6d2235e77e8079b8d22eba (diff) | |
| download | go-c7f7bbbf03415e1805e503846627f2e08423c360.tar.xz | |
runtime: fix build on linux
In addition to the compile failure fixed in signal*.c,
preserving the signal mask led to very strange crashes.
Testing shows that looking for SIG_IGN is all that
matters to get along with nohup, so reintroduce
sigset_zero instead of trying to preserve the signal mask.
TBR=iant
CC=golang-dev
https://golang.org/cl/7323067
Diffstat (limited to 'src/pkg/runtime/thread_linux.c')
| -rw-r--r-- | src/pkg/runtime/thread_linux.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/pkg/runtime/thread_linux.c b/src/pkg/runtime/thread_linux.c index 604b98e57f..1a7eb7240c 100644 --- a/src/pkg/runtime/thread_linux.c +++ b/src/pkg/runtime/thread_linux.c @@ -13,6 +13,7 @@ int32 runtime·open(uint8*, int32, int32); int32 runtime·close(int32); int32 runtime·read(int32, void*, int32); +static Sigset sigset_none; static Sigset sigset_all = { ~(uint32)0, ~(uint32)0 }; // Linux futex. @@ -148,8 +149,6 @@ runtime·newosproc(M *mp, G *gp, void *stk, void (*fn)(void)) // Disable signals during clone, so that the new thread starts // with signals disabled. It will enable them in minit. runtime·rtsigprocmask(SIG_SETMASK, &sigset_all, &oset, sizeof oset); - mp->sigset = runtime·mal(sizeof(Sigset)); - *(Sigset*)mp->sigset = oset; ret = runtime·clone(flags, stk, mp, gp, fn); runtime·rtsigprocmask(SIG_SETMASK, &oset, nil, sizeof oset); @@ -178,8 +177,7 @@ runtime·minit(void) // Initialize signal handling. m->gsignal = runtime·malg(32*1024); // OS X wants >=8K, Linux >=2K runtime·signalstack((byte*)m->gsignal->stackguard - StackGuard, 32*1024); - if(m->sigset != nil) - runtime·rtsigprocmask(SIG_SETMASK, m->sigset, nil, sizeof *m->sigset); + runtime·rtsigprocmask(SIG_SETMASK, &sigset_none, nil, sizeof(Sigset)); } void |
