Subject: bin/2901: one call to sigismember too many in mail(1)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <onno@simplex.nl>
List: netbsd-bugs
Date: 10/28/1996 22:51:47
>Number:         2901
>Category:       bin
>Synopsis:       one call to sigismember too many in mail(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 28 14:05:01 1996
>Last-Modified:
>Originator:     Onno van der Linden
>Organization:
	
>Release:        1.2B
>Environment:
	
System: NetBSD sheep 1.2B NetBSD 1.2B (SHEEP) #11: Sun Oct 27 19:57:37 MET 1996 onno@sheep:/usr/src/sys/arch/i386/compile/SHEEP i386


>Description:
        one call to sigismember too many in prepare_child() in popen.c
>How-To-Repeat:
        NSIG equals _NSIG
        and in /usr/include/signal.h it says
        if (signo <= 0 || signo >= _NSIG) {
                errno = 22; /* EINVAL */
                return -1
        }
        and prepare_child() uses
        for (i = 1; i <= NSIG; i++)
               if (sigismember(nset, i))
                     (void) signal(i, SIG_IGN);

        which means sigismember(nset, NSIG) isn't useful.
	
>Fix:
	
        I think the definition in signal.h is wrong. _NSIG is still a valid
        signal which means all the
        if (signo <= 0 || signo >= _NSIG) statements in signal.h should
        become
        if (signo <= 0 || signo > _NSIG)
>Audit-Trail:
>Unformatted: