]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/util.c
kill: always send SIGCONT after SIGTERM
[thirdparty/systemd.git] / src / util.c
index e2859fafc1b115215eb7638125a126e031aa1bf5..23d7e2211d8a94c1642452627b24ff208ead8559 100644 (file)
@@ -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",