From: Rich Felker Date: Mon, 16 Sep 2013 16:58:51 +0000 (-0400) Subject: fix sigemptyset and sigfillset for mips X-Git-Tag: v0.9.14~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0753b1faf002249dc35ef09cb4769d66fa3a1a86;p=oweals%2Fmusl.git fix sigemptyset and sigfillset for mips they were leaving junk in the upper bits. --- diff --git a/src/signal/sigemptyset.c b/src/signal/sigemptyset.c index ca9b8920..1d07471d 100644 --- a/src/signal/sigemptyset.c +++ b/src/signal/sigemptyset.c @@ -4,6 +4,10 @@ int sigemptyset(sigset_t *set) { set->__bits[0] = 0; - if (sizeof(long)==4) set->__bits[1] = 0; + if (sizeof(long)==4 || _NSIG > 65) set->__bits[1] = 0; + if (sizeof(long)==4 && _NSIG > 65) { + set->__bits[2] = 0; + set->__bits[3] = 0; + } return 0; } diff --git a/src/signal/sigfillset.c b/src/signal/sigfillset.c index 6c84b9b7..4d0a807a 100644 --- a/src/signal/sigfillset.c +++ b/src/signal/sigfillset.c @@ -7,8 +7,13 @@ int sigfillset(sigset_t *set) #if ULONG_MAX == 0xffffffff set->__bits[0] = 0x7ffffffful; set->__bits[1] = 0xfffffffcul; + if (_NSIG > 65) { + set->__bits[2] = 0xfffffffful; + set->__bits[3] = 0xfffffffful; + } #else set->__bits[0] = 0xfffffffc7ffffffful; + if (_NSIG > 65) set->__bits[1] = 0xfffffffffffffffful; #endif return 0; }