summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-03-03 23:55:30 +0100
committerLennart Poettering <lennart@poettering.net>2011-03-03 23:55:30 +0100
commit430c18ed7f576fd9041b0a02e7c4210bdd020a25 (patch)
tree0ea2aa6c3d7c434c1c8b5dd2c91ca7b54a7771c4 /src/util.c
parent2b590e135f53a1bd3e771bdc555f7bf28c4cd232 (diff)
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.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c11
1 files changed, 11 insertions, 0 deletions
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",