summaryrefslogtreecommitdiff
path: root/src/basic/process-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-26 01:13:11 +0100
committerLennart Poettering <lennart@poettering.net>2015-10-26 01:24:39 +0100
commit4d0d3d41d21f34f28ee67b8b1952af88ada7abaf (patch)
tree82303ad33953a655b9eaa75324e929a38146dff8 /src/basic/process-util.c
parent2583fbea8e762d2e915582af60560f884d5093f5 (diff)
process-util: move more process related calls to process-util.[ch]
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;