From: Andre Noll Date: Tue, 14 Nov 2017 03:12:02 +0000 (+0100) Subject: run: Don't kill children twice. X-Git-Tag: v1.0.0~2 X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=commitdiff_plain;h=45ae697d187c12a7ed40ae71b6a8adeda4b32b6c run: Don't kill children twice. When handle_signal(), the signal dispatcher of the run subcommand, detects that SIGINT or SIGTERM was received, it calls kill_children() to terminate any running rsync or rm processes. It then returns negative which terminates the select loop. However, after select_loop() returns, kill_children() is called again. Also the error message is logged twice. Not a biggie, but let's get rid of this redundancy by removing the first call to kill_children(). Since handle_signal() is only called from com_run(), this patch affects only the run subcommand. --- diff --git a/dss.c b/dss.c index 9390f48..1d7f7fb 100644 --- a/dss.c +++ b/dss.c @@ -1301,9 +1301,7 @@ static int handle_signal(void) switch (sig) { case SIGINT: case SIGTERM: - kill_children(); - ret = -E_SIGNAL; - break; + return -E_SIGNAL; case SIGHUP: ret = handle_sighup(); break;