summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sshd.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2002-03-30 18:51:15 +0000
committermarkus <markus@openbsd.org>2002-03-30 18:51:15 +0000
commitd16f19a93e36c7bfdc110ac4610d165f1a74de66 (patch)
tree0fd94b045ace9ce27a3a8f09d8f8fe82b4a33bcf /usr.bin/ssh/sshd.c
parentimplement WEP in wi_do_hostencrypt() (diff)
downloadwireguard-openbsd-d16f19a93e36c7bfdc110ac4610d165f1a74de66.tar.xz
wireguard-openbsd-d16f19a93e36c7bfdc110ac4610d165f1a74de66.zip
check waitpid for EINTR; based on patch from peter@ifm.liu.se
Diffstat (limited to 'usr.bin/ssh/sshd.c')
-rw-r--r--usr.bin/ssh/sshd.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index 88dd5b65b3c..16361eebbe6 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/sshd.c
@@ -42,7 +42,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.238 2002/03/23 20:57:26 stevesk Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.239 2002/03/30 18:51:15 markus Exp $");
#include <openssl/dh.h>
#include <openssl/bn.h>
@@ -267,10 +267,12 @@ sigterm_handler(int sig)
static void
main_sigchld_handler(int sig)
{
+ pid_t pid;
int save_errno = errno;
int status;
- while (waitpid(-1, &status, WNOHANG) > 0)
+ while ((pid = waitpid(-1, &status, WNOHANG)) > 0 ||
+ (pid < 0 && errno == EINTR))
;
signal(SIGCHLD, main_sigchld_handler);
@@ -568,8 +570,9 @@ privsep_preauth(void)
monitor_sync(monitor);
/* Wait for the child's exit status */
- waitpid(pid, &status, 0);
-
+ while (waitpid(pid, &status, 0) < 0)
+ if (errno != EINTR)
+ break;
return (authctxt);
} else {
/* child */