From 430c18ed7f576fd9041b0a02e7c4210bdd020a25 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 3 Mar 2011 23:55:30 +0100 Subject: kill: always send SIGCONT after SIGTERM When we kill a process to terminate it make sure to send SIGCONT to ensure it is unpaused and processes the signal. --- src/util.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index e2859fafc1..23d7e2211d 100644 --- a/src/util.c +++ b/src/util.c @@ -3977,6 +3977,17 @@ finish: hashmap_free_free(pids); } +int kill_and_sigcont(pid_t pid, int sig) { + int r; + + r = kill(pid, sig) < 0 ? -errno : 0; + + if (r >= 0) + kill(pid, SIGCONT); + + return r; +} + static const char *const ioprio_class_table[] = { [IOPRIO_CLASS_NONE] = "none", [IOPRIO_CLASS_RT] = "realtime", -- cgit v1.2.3-54-g00ecf