From c12d8edf76feff3c9a77bd243c492ded5225c01d Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sat, 20 Nov 1999 20:07:24 +0000 Subject: fix sigchld race; cjc5@po.cwru.edu --- usr.bin/ssh/sshd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'usr.bin/ssh') diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index d085e4d3857..d06372a19c6 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -18,7 +18,7 @@ agent connections. */ #include "includes.h" -RCSID("$Id: sshd.c,v 1.59 1999/11/19 19:58:18 markus Exp $"); +RCSID("$Id: sshd.c,v 1.60 1999/11/20 20:07:23 deraadt Exp $"); #include "xmalloc.h" #include "rsa.h" @@ -170,7 +170,10 @@ void main_sigchld_handler(int sig) { int save_errno = errno; int status; - wait(&status); + + while (waitpid(-1, &status, WNOHANG) > 0) + ; + signal(SIGCHLD, main_sigchld_handler); errno = save_errno; } -- cgit v1.2.3