Re: [PHP4BETA] cvs: php4 / acconfig.h.in config.w32.h configure.in main.c
| From: | thies at digicol dot de | Date: | Fri, 19 May 2000 11:47:36 +0000 |
| Subject: | Re: [PHP4BETA] cvs: php4 / acconfig.h.in config.w32.h configure.in main.c | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-15234@lists.php.net to get a copy of this message | ||
On Fri, May 19, 2000 at 01:31:40PM +0200, Sascha Schumann wrote:
> > +#if PHP_SIGCHILD
> > +static int sigchld_handler(int apar)
> > +{
> > + int status;
> > + wait(&status);
> > + signal(SIGCHLD,sigchld_handler);
> > +}
> > +#endif
>
> This is an often repeated error when dealing with reapers.
>
> An arbitrary number of childs can exit while you are in the signal
> handler, so that no further SIGCHLD are delivered to the program.
>
> The
>
> wait(&status);
>
> should be modified to
>
> while (waitpid(-1, NULL, WNOHANG) > 0);
>
> waitpid() will return immediately with -1, if no child has
> exited. Otherwise, it will return the pid of the child.
fixed - thanx
>
> - Sascha
--
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany