run: Don't kill children twice.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 14 Nov 2017 03:12:02 +0000 (04:12 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 19 Nov 2017 01:53:33 +0000 (02:53 +0100)
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.

dss.c

diff --git a/dss.c b/dss.c
index 9390f48..1d7f7fb 100644 (file)
--- 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;