From 745da983ede2fd45c95f3fb48984083c0ae6b9d1 Mon Sep 17 00:00:00 2001 From: infirit Date: Thu, 20 Nov 2014 17:11:50 +0100 Subject: When canceling an operation kill all the sub-processes as well create a new process group and kill the process group to stop the operation. Based on FR commit: baff9720f59d85d5118ca0220b7c680dc6964d30 From: Paolo Bacchilega --- src/fr-process.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/fr-process.c b/src/fr-process.c index 8855157..61ed636 100644 --- a/src/fr-process.c +++ b/src/fr-process.c @@ -643,6 +643,11 @@ child_setup (gpointer user_data) /* detach from the tty */ setsid (); + + /* create a process group to kill all the child processes when + * canceling the operation. */ + + setpgid (0, 0); } @@ -999,7 +1004,7 @@ fr_process_stop_priv (FrProcess *process, allow_sticky_processes_only (process, emit_signal); else if (process->term_on_stop && (process->priv->command_pid > 0)) - kill (process->priv->command_pid, SIGTERM); + killpg (process->priv->command_pid, SIGTERM); else { if (process->priv->check_timeout != 0) { -- cgit v1.2.1