summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sshd.c b/sshd.c
index 541e9932e..2e21d3d4e 100644
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
42 */ 42 */
43 43
44#include "includes.h" 44#include "includes.h"
45RCSID("$OpenBSD: sshd.c,v 1.238 2002/03/23 20:57:26 stevesk Exp $"); 45RCSID("$OpenBSD: sshd.c,v 1.239 2002/03/30 18:51:15 markus Exp $");
46 46
47#include <openssl/dh.h> 47#include <openssl/dh.h>
48#include <openssl/bn.h> 48#include <openssl/bn.h>
@@ -276,10 +276,12 @@ sigterm_handler(int sig)
276static void 276static void
277main_sigchld_handler(int sig) 277main_sigchld_handler(int sig)
278{ 278{
279 pid_t pid;
279 int save_errno = errno; 280 int save_errno = errno;
280 int status; 281 int status;
281 282
282 while (waitpid(-1, &status, WNOHANG) > 0) 283 while ((pid = waitpid(-1, &status, WNOHANG)) > 0 ||
284 (pid < 0 && errno == EINTR))
283 ; 285 ;
284 286
285 signal(SIGCHLD, main_sigchld_handler); 287 signal(SIGCHLD, main_sigchld_handler);
@@ -577,8 +579,9 @@ privsep_preauth(void)
577 monitor_sync(monitor); 579 monitor_sync(monitor);
578 580
579 /* Wait for the child's exit status */ 581 /* Wait for the child's exit status */
580 waitpid(pid, &status, 0); 582 while (waitpid(pid, &status, 0) < 0)
581 583 if (errno != EINTR)
584 break;
582 return (authctxt); 585 return (authctxt);
583 } else { 586 } else {
584 /* child */ 587 /* child */