added a more graceful termination of workers.

This commit is contained in:
Nikos Mavrogiannopoulos
2013-02-08 19:19:11 +01:00
parent 4434fd70fe
commit 089bbed715
2 changed files with 55 additions and 13 deletions

View File

@@ -535,8 +535,9 @@ int main(int argc, char** argv)
for (;;) {
if (terminate != 0) {
mslog(&s, NULL, LOG_DEBUG, "termination signal received; waiting for children to die");
kill_children(&clist);
sleep(1);
while (waitpid(-1, NULL, 0) > 0);
exit(0);
}