diff options
author | Tom Gundersen <teg@jklm.no> | 2015-10-26 13:21:41 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-10-26 13:21:41 +0100 |
commit | ad1a44b23bbc909aa3f5876dadd482a9f6c18d5c (patch) | |
tree | 97fc092ae75eddafb746b58d2254c6af953f1e9e /src/basic/process-util.c | |
parent | 0dec689b098cf62b948d43dc78bde859665056ec (diff) | |
parent | 4d0d3d41d21f34f28ee67b8b1952af88ada7abaf (diff) |
Merge pull request #1676 from poettering/util-lib-2
split up util.[ch] into more pieces, and other stuff
Diffstat (limited to 'src/basic/process-util.c')
-rw-r--r-- | src/basic/process-util.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/basic/process-util.c b/src/basic/process-util.c index 949bd1f64d..72fc82e7cb 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -35,6 +35,7 @@ #include "process-util.h" #include "signal-util.h" #include "string-util.h" +#include "user-util.h" #include "util.h" int get_process_state(pid_t pid) { @@ -479,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; |