summaryrefslogtreecommitdiff
path: root/serverloop.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-10-28 13:30:55 +1100
committerDamien Miller <djm@mindrot.org>2000-10-28 13:30:55 +1100
commit6bd90df4909b90143093536254fce86342f63eaa (patch)
treedc78abb0a467a16012d9acd1f561e879ecafe9be /serverloop.c
parente95b52e90bc1c3b411c9ce309cbc6291c8ec77ad (diff)
- (djm) fix select hack in serverloop.c from Philippe WILLEM
<Philippe.WILLEM@urssaf.fr>
Diffstat (limited to 'serverloop.c')
-rw-r--r--serverloop.c5
1 files changed, 4 insertions, 1 deletions
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);