From 6bd90df4909b90143093536254fce86342f63eaa Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 28 Oct 2000 13:30:55 +1100 Subject: [PATCH] - (djm) fix select hack in serverloop.c from Philippe WILLEM --- CREDITS | 1 + ChangeLog | 4 ++++ serverloop.c | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index 139f61717..8831cdd5a 100644 --- a/CREDITS +++ b/CREDITS @@ -67,6 +67,7 @@ Pekka Savola - Bugfixes Peter Kocks - Makefile fixes Phil Hands - Debian scripts, assorted patches Phil Karn - Autoconf fixes +Philippe WILLEM - Bugfixes Phill Camp - login code fix Rip Loomis - Solaris package support, fixes SAKAI Kiyotaka - Multiple bugfixes diff --git a/ChangeLog b/ChangeLog index 9cfb58dd8..79f9c7bf0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20001028 + - (djm) fix select hack in serverloop.c from Philippe WILLEM + + 20001027 - (djm) Increase REKEY_BYTES to 2^24 for arc4random diff --git a/serverloop.c b/serverloop.c index d98d74c25..a9e478764 100644 --- a/serverloop.c +++ b/serverloop.c @@ -99,9 +99,10 @@ sigchld_handler(int sig) error("Strange, got SIGCHLD and wait returned pid %d but child is %d", wait_pid, child_pid); if (WIFEXITED(child_wait_status) || - WIFSIGNALED(child_wait_status)) + WIFSIGNALED(child_wait_status)) { child_terminated = 1; child_has_selected = 0; + } } signal(SIGCHLD, sigchld_handler); errno = save_errno; @@ -112,6 +113,7 @@ sigchld_handler2(int sig) int save_errno = errno; debug("Received SIGCHLD."); child_terminated = 1; + child_has_selected = 0; errno = save_errno; } @@ -678,6 +680,7 @@ server_loop2(void) while ((pid = waitpid(-1, &status, WNOHANG)) > 0) session_close_by_pid(pid, status); child_terminated = 0; + child_has_selected = 0; signal(SIGCHLD, sigchld_handler2); } channel_after_select(&readset, &writeset);