$NetBSD: patch-aa,v 1.2 2009/08/18 05:40:44 hasso Exp $

http://git.0pointer.de/?p=libdaemon.git;a=commitdiff;h=5b1daf07

--- libdaemon/dfork.c.orig	2008-07-28 22:37:56 +0300
+++ libdaemon/dfork.c	2009-08-18 08:25:30 +0300
@@ -42,6 +42,14 @@
 #include "dnonblock.h"
 #include "dlog.h"
 
+#if defined(_NSIG) /* On glibc NSIG does not count RT signals */
+# define SIGNAL_UPPER_BOUND _NSIG
+#elif defined(NSIG) /* Solaris defines just this */
+# define SIGNAL_UPPER_BOUND NSIG
+#else
+# error "Unknown upper bound for signals"
+#endif
+
 static int _daemon_retval_pipe[2] = { -1, -1 };
 
 static int _null_open(int f, int fd) {
@@ -665,7 +673,7 @@ int daemon_reset_sigs(int except, ...) {
 int daemon_reset_sigsv(const int except[]) {
     int sig;
 
-    for (sig = 1; sig < _NSIG; sig++) {
+    for (sig = 1; sig < SIGNAL_UPPER_BOUND; sig++) {
         int reset = 1;
 
         switch (sig) {
