- (djm) Fix server not exiting with jobs in background.
diff --git a/serverloop.c b/serverloop.c
index 00617bb..8c17c0d 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -86,6 +86,7 @@
int save_errno = errno;
debug("Received SIGCHLD.");
child_terminated = 1;
+ child_has_selected = 0;
errno = save_errno;
}
@@ -652,6 +653,8 @@
signal(SIGCHLD, sigchld_handler2);
}
channel_after_select(&readset, &writeset);
+ if (child_terminated && child_has_selected)
+ break;
process_input(&readset);
process_output(&writeset);
}