possible sigchld bug
Markus Friedl
markus at openbsd.org
Tue Dec 23 07:00:21 EST 2003
signals are not blocked during execution of handlers?
On Mon, Dec 22, 2003 at 08:26:28PM +0100, Mikulas Patocka wrote:
> Hi
>
> What if you have sysv signals (i.e. signal is restored when handler is
> called) and child process exits here? Zombie will be left, because SIGCHLD
> is ignored at that point. Shouldn't signal be before waitpid?
>
> Mikulas
>
> static void
> main_sigchld_handler(int sig)
> {
> int save_errno = errno;
> pid_t pid;
> int status;
>
> while ((pid = waitpid(-1, &status, WNOHANG)) > 0 ||
> (pid < 0 && errno == EINTR))
> ;
>
> <----- HERE
>
> signal(SIGCHLD, main_sigchld_handler);
> errno = save_errno;
> }
>
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev at mindrot.org
> http://www.mindrot.org/mailman/listinfo/openssh-unix-dev
More information about the openssh-unix-dev
mailing list