From: Joel Sing Date: Thu, 10 May 2012 17:48:16 +0000 (+1000) Subject: runtime: fix netbsd sigaction struct X-Git-Tag: go1.1rc2~3224 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=38445ca08915c0fb755f9f15f99a3226ed7f45f4;p=gostls13.git runtime: fix netbsd sigaction struct R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6198063 --- diff --git a/src/pkg/runtime/signal_netbsd_386.c b/src/pkg/runtime/signal_netbsd_386.c index 39d829484d..b4871ee8e0 100644 --- a/src/pkg/runtime/signal_netbsd_386.c +++ b/src/pkg/runtime/signal_netbsd_386.c @@ -11,10 +11,10 @@ extern void runtime·sigtramp(void); typedef struct sigaction { union { - void (*__sa_handler)(int32); - void (*__sa_sigaction)(int32, Siginfo*, void *); - } __sigaction_u; /* signal handler */ - uint32 sa_mask; /* signal mask to apply */ + void (*_sa_handler)(int32); + void (*_sa_sigaction)(int32, Siginfo*, void *); + } _sa_u; /* signal handler */ + uint32 sa_mask[4]; /* signal mask to apply */ int32 sa_flags; /* see signal options below */ } Sigaction; @@ -124,9 +124,12 @@ runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart) sa.sa_flags = SA_SIGINFO|SA_ONSTACK; if(restart) sa.sa_flags |= SA_RESTART; - sa.sa_mask = ~0ULL; + sa.sa_mask[0] = ~0U; + sa.sa_mask[1] = ~0U; + sa.sa_mask[2] = ~0U; + sa.sa_mask[3] = ~0U; if (fn == runtime·sighandler) fn = (void*)runtime·sigtramp; - sa.__sigaction_u.__sa_sigaction = (void*)fn; + sa._sa_u._sa_sigaction = (void*)fn; runtime·sigaction(i, &sa, nil); } diff --git a/src/pkg/runtime/signal_netbsd_amd64.c b/src/pkg/runtime/signal_netbsd_amd64.c index 8b4f624e7c..a27f9db24d 100644 --- a/src/pkg/runtime/signal_netbsd_amd64.c +++ b/src/pkg/runtime/signal_netbsd_amd64.c @@ -11,10 +11,10 @@ extern void runtime·sigtramp(void); typedef struct sigaction { union { - void (*__sa_handler)(int32); - void (*__sa_sigaction)(int32, Siginfo*, void *); - } __sigaction_u; /* signal handler */ - uint32 sa_mask; /* signal mask to apply */ + void (*_sa_handler)(int32); + void (*_sa_sigaction)(int32, Siginfo*, void *); + } _sa_u; /* signal handler */ + uint32 sa_mask[4]; /* signal mask to apply */ int32 sa_flags; /* see signal options below */ } Sigaction; @@ -133,9 +133,12 @@ runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart) sa.sa_flags = SA_SIGINFO|SA_ONSTACK; if(restart) sa.sa_flags |= SA_RESTART; - sa.sa_mask = ~0ULL; + sa.sa_mask[0] = ~0U; + sa.sa_mask[1] = ~0U; + sa.sa_mask[2] = ~0U; + sa.sa_mask[3] = ~0U; if (fn == runtime·sighandler) fn = (void*)runtime·sigtramp; - sa.__sigaction_u.__sa_sigaction = (void*)fn; + sa._sa_u._sa_sigaction = (void*)fn; runtime·sigaction(i, &sa, nil); }