summaryrefslogtreecommitdiff
path: root/serverloop.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-10-15 12:21:32 +1100
committerDamien Miller <djm@mindrot.org>2000-10-15 12:21:32 +1100
commit5993935f76e66c957f02efaa8fc0c8ff8a3f92c9 (patch)
treeb8bc95b6caf3a4eeb66645409be9728c327ea6d9 /serverloop.c
parentb4df15d1e119994ad1f3e73c1283414d2eb30a5f (diff)
- (djm) Fix ssh2 hang on background processes at logout.
Diffstat (limited to 'serverloop.c')
-rw-r--r--serverloop.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/serverloop.c b/serverloop.c
index 25320348..0c07a282 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -671,7 +671,8 @@ server_loop2(void)
if (packet_not_very_much_data_to_write())
channel_output_poll();
wait_until_can_do_something(&readset, &writeset, 0);
- if (child_terminated) {
+ if (child_terminated && child_has_selected) {
+ /* XXX: race - assumes only one child has terminated */
while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
session_close_by_pid(pid, status);
child_terminated = 0;