From: Andre Noll Date: Mon, 16 Oct 2017 15:36:51 +0000 (+0200) Subject: run: Wait for children to die. X-Git-Tag: v1.0.0~7^2~1 X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=commitdiff_plain;h=96c620fcf383faffb16c89c2ddd9b0857de6dfbb;hp=3e8d431fb78e95c0d595b6e7e37ff248c0fa4edd run: Wait for children to die. When the select loop returns and dss is about to terminate, it sends SIGTERM to any running rm or rsync processes and exits. It does not wait for these processes to die, however. This is trivial to implement, and it makes life easier for shutdown scripts which like to proceed with unmounting file systems. --- diff --git a/dss.c b/dss.c index 3e626ab..e9bd56a 100644 --- a/dss.c +++ b/dss.c @@ -1565,6 +1565,8 @@ static int com_run(void) ret = -E_BUG; kill_children(); exit_hook(ret); + while (wait(NULL) >= 0 || errno != ECHILD) + ; /* still have children to wait for */ return ret; } EXPORT_CMD_HANDLER(run);