diff options
author | Sven Eden <yamakuzure@gmx.net> | 2017-05-24 13:51:31 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-06-16 10:12:58 +0200 |
commit | c733f9b08d9eadc5e671185112567ada81116bdf (patch) | |
tree | 5755965b950423eae4b3c8f462acaf940a9ad684 /src/basic/process-util.c | |
parent | c6edc23d5f8a483e93a891bf7eb76b5f4caf2fb4 (diff) |
Prep v230: Apply missing upstream fixes and updates (2/8) src/basic.
Diffstat (limited to 'src/basic/process-util.c')
-rw-r--r-- | src/basic/process-util.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/basic/process-util.c b/src/basic/process-util.c index d146638b8..f418b85b9 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -38,7 +38,7 @@ #endif #include "alloc-util.h" -#include "architecture.h" +//#include "architecture.h" #include "escape.h" #include "fd-util.h" #include "fileio.h" @@ -207,7 +207,7 @@ void rename_process(const char name[8]) { * "systemd"). If you pass a longer string it will be * truncated */ - prctl(PR_SET_NAME, name); + (void) prctl(PR_SET_NAME, name); if (program_invocation_name) strncpy(program_invocation_name, name, strlen(program_invocation_name)); @@ -413,7 +413,7 @@ int get_process_environ(pid_t pid, char **env) { if (!outcome) return -ENOMEM; } else - outcome[sz] = '\0'; + outcome[sz] = '\0'; *env = outcome; outcome = NULL; @@ -534,17 +534,23 @@ 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 0 /// UNNEEDED by elogind +void sigkill_wait(pid_t pid) { + assert(pid > 1); + + if (kill(pid, SIGKILL) > 0) + (void) wait_for_terminate(pid, NULL); +} + +void sigkill_waitp(pid_t *pid) { if (!pid) return; if (*pid <= 1) return; - if (kill(*pid, SIGKILL) > 0) - (void) wait_for_terminate(*pid, NULL); + sigkill_wait(*pid); } -#if 0 /// UNNEEDED by elogind int kill_and_sigcont(pid_t pid, int sig) { int r; @@ -672,6 +678,8 @@ bool is_main_thread(void) { #if 0 /// UNNEEDED by elogind noreturn void freeze(void) { + log_close(); + /* Make sure nobody waits for us on a socket anymore */ close_all_fds(NULL, 0); |