From 38445ca08915c0fb755f9f15f99a3226ed7f45f4 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Fri, 11 May 2012 03:48:16 +1000 Subject: [PATCH] runtime: fix netbsd sigaction struct R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6198063 --- src/pkg/runtime/signal_netbsd_386.c | 15 +++++++++------ src/pkg/runtime/signal_netbsd_amd64.c | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/pkg/runtime/signal_netbsd_386.c b/src/pkg/runtime/signal_netbsd_386.c index 39d829484de..b4871ee8e08 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 8b4f624e7cb..a27f9db24db 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); }