]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
_NSIG seems to be the norm. Use _SIG_MAXSIG if available otherwise guess.
authorRoy Marples <roy@marples.name>
Sat, 10 Nov 2012 17:29:34 +0000 (17:29 +0000)
committerRoy Marples <roy@marples.name>
Sat, 10 Nov 2012 17:29:34 +0000 (17:29 +0000)
compat/posix_spawn.c

index 35dcf0feb35a13aec57f2a47b0b190e7a0d239a6..1e07f3b6d0c327429ed20fdef54169baf1ead550 100644 (file)
 #include "../common.h"
 #include "posix_spawn.h"
 
+#ifndef _NSIG
+#ifdef _SIG_MAXSIG
+#define _NSIG _SIG_MAXSIG + 1
+#else
 /* Guess */
-#ifndef _SIG_MAXSIG
-#define _SIG_MAXSIG SIGPWR
+#define _NSIG SIGPWR + 1
+#endif
 #endif
 
 extern char **environ;
@@ -61,7 +65,7 @@ posix_spawnattr_handle(const posix_spawnattr_t *attrp)
        if (attrp->posix_attr_flags & POSIX_SPAWN_SETSIGDEF) {
                sa.sa_flags = 0;
                sa.sa_handler = SIG_DFL;
-               for (i = 1; i <= _SIG_MAXSIG; i++) {
+               for (i = 1; i < _NSIG; i++) {
                        if (sigismember(&attrp->posix_attr_sigdefault, i)) {
                                if (sigaction(i, &sa, NULL) == -1)
                                        return -1;