* Ben Smithurst <[EMAIL PROTECTED]> [000825 10:15] wrote:
> '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");

The code I presented is flawed as a result of an allnighter dealing
with postresql.  I'll enjoy thinking about this over the weekend. :)

-Alfred


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

Reply via email to