summaryrefslogtreecommitdiff
path: root/src/basic/process-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/process-util.c')
-rw-r--r--src/basic/process-util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index 65c93792fb..72fc82e7cb 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -480,6 +480,16 @@ int wait_for_terminate_and_warn(const char *name, pid_t pid, bool check_exit_cod
return -EPROTO;
}
+void sigkill_wait(pid_t *pid) {
+ if (!pid)
+ return;
+ if (*pid <= 1)
+ return;
+
+ if (kill(*pid, SIGKILL) > 0)
+ (void) wait_for_terminate(*pid, NULL);
+}
+
int kill_and_sigcont(pid_t pid, int sig) {
int r;