summaryrefslogtreecommitdiff
path: root/serverloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'serverloop.c')
-rw-r--r--serverloop.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/serverloop.c b/serverloop.c
index 00617bb8..8c17c0d5 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -86,6 +86,7 @@ sigchld_handler2(int sig)
int save_errno = errno;
debug("Received SIGCHLD.");
child_terminated = 1;
+ child_has_selected = 0;
errno = save_errno;
}
@@ -652,6 +653,8 @@ server_loop2(void)
signal(SIGCHLD, sigchld_handler2);
}
channel_after_select(&readset, &writeset);
+ if (child_terminated && child_has_selected)
+ break;
process_input(&readset);
process_output(&writeset);
}