From: Matthew Dempsky Date: Mon, 2 Mar 2015 03:13:50 +0000 (-0800) Subject: runtime: change sigset_all and sigset_none into constants on OpenBSD X-Git-Tag: go1.5beta1~1780 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5324cf2d45387b534068cf651e2d18e5df25d0b9;p=gostls13.git runtime: change sigset_all and sigset_none into constants on OpenBSD OpenBSD's sigprocmask system call passes the signal mask by value rather than reference, so vars are unnecessary. Additionally, declaring "var sigset_all = ^sigset_none" means sigset_all won't be initialized until runtime_init is called, but the first call to newosproc happens before then. I've witnessed Go processes on OpenBSD crash from receiving SIGWINCH on the newly created OS thread before it finished initializing. Change-Id: I16995e7e466d5e7e50bcaa7d9490173789a0b4cc Reviewed-on: https://go-review.googlesource.com/6440 Reviewed-by: Mikio Hara Reviewed-by: Brad Fitzpatrick --- diff --git a/src/runtime/os1_openbsd.go b/src/runtime/os1_openbsd.go index d23d812ace..04779ea870 100644 --- a/src/runtime/os1_openbsd.go +++ b/src/runtime/os1_openbsd.go @@ -19,8 +19,10 @@ const ( _CLOCK_MONOTONIC = 3 ) -var sigset_none = uint32(0) -var sigset_all = ^sigset_none +const ( + sigset_none = uint32(0) + sigset_all = ^uint32(0) +) // From OpenBSD's const (