'Alfred Perlstein' wrote:

> int
> sigchld_handler(int) 
> {
> 
>       while (waitpid(-1, NULL, 0) || errno == EINTR)
>               ;
> }

Even more paranoid would be

int
sigchld_handler(int)
{
        int e = errno;

        while (waitpid(-1, NULL, 0) || errno == EINTR)
                ;

        errno = e;
}

otherwise you could get bogus errors reported, I think.

        if ((fp = fopen(foo, "r")) == NULL)
                /* SIGCHLD arrives here */
                warn("can't open foo");

-- 
Ben Smithurst / [EMAIL PROTECTED] / PGP: 0x99392F7D


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to