From 344f2b948b1bc5b234af0e42074faa88c0462346 Mon Sep 17 00:00:00 2001 From: djm Date: Sat, 28 Oct 2000 02:30:55 +0000 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 139f6171..8831cdd5 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 9cfb58dd..79f9c7bf 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 d98d74c2..a9e47876 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); -- 2.45.2