summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-11-20 20:07:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-11-20 20:07:24 +0000
commitc12d8edf76feff3c9a77bd243c492ded5225c01d (patch)
tree3d539d7a797081ea5c71e4cd22964be26aded79c
parentfa858c49f8dede69ec1f4d3680d0b451562a40e7 (diff)
fix sigchld race; cjc5@po.cwru.edu
-rw-r--r--usr.bin/ssh/sshd.c7
1 files changed, 5 insertions, 2 deletions
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;
}