diff options
| author | Andre Noll <maan@systemlinux.org> | 2014-01-14 15:15:38 +0100 |
|---|---|---|
| committer | Andre Noll <maan@systemlinux.org> | 2014-01-14 15:16:19 +0100 |
| commit | 641e3804cd87fb07b6089facd92f4452e5e3aa12 (patch) | |
| tree | a3e0d9fdd3f68fdb172b000d1e7b01d0a6ec8989 | |
| parent | f33cf243ae1cb5657cccb7c43c99093936093b4a (diff) | |
| parent | 19982b7b17a603bd4a0b47c724b4e830daaf88d9 (diff) | |
Merge branch 't/exit_fix'
Was cooking since 2013-10.
| -rw-r--r-- | dss.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1038,6 +1038,13 @@ static int handle_sighup(void) return change_to_dest_dir(); } +static void kill_children(void) +{ + restart_create_process(); + dss_kill(create_pid, SIGTERM, NULL); + dss_kill(remove_pid, SIGTERM, NULL); +} + static int handle_signal(void) { int sig, ret = next_signal(); @@ -1048,9 +1055,7 @@ static int handle_signal(void) switch (sig) { case SIGINT: case SIGTERM: - restart_create_process(); - dss_kill(create_pid, SIGTERM, NULL); - dss_kill(remove_pid, SIGTERM, NULL); + kill_children(); ret = -E_SIGNAL; break; case SIGHUP: @@ -1319,6 +1324,7 @@ static int com_run(void) ret = select_loop(); if (ret >= 0) /* impossible */ ret = -E_BUG; + kill_children(); exit_hook(ret); return ret; } @@ -1442,7 +1448,7 @@ static int com_ls(void) if (s->flags & SS_COMPLETE) d = (s->completion_time - s->creation_time) / 60; dss_msg("%u\t%s\t%3" PRId64 ":%02" PRId64 "\n", s->interval, s->name, d/60, d%60); - }; + } free_snapshot_list(&sl); return 1; } |
