]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
process-util: move more process related calls to process-util.[ch] 1676/head
authorLennart Poettering <lennart@poettering.net>
Mon, 26 Oct 2015 00:13:11 +0000 (01:13 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 26 Oct 2015 00:24:39 +0000 (01:24 +0100)
src/basic/process-util.c
src/basic/process-util.h
src/basic/util.c
src/basic/util.h

index 65c93792fbfdae101ab2b94f8462467b35562a08..72fc82e7cb78f7ec18313ce141c9b21ebc0f8014 100644 (file)
@@ -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;
 
index 07431d043b79df374a81c873332e9c0475260ca7..2c0d1af0006c5da205aed3a99b1507d5afc49c19 100644 (file)
@@ -55,6 +55,9 @@ int get_process_environ(pid_t pid, char **environ);
 int wait_for_terminate(pid_t pid, siginfo_t *status);
 int wait_for_terminate_and_warn(const char *name, pid_t pid, bool check_exit_code);
 
+void sigkill_wait(pid_t *pid);
+#define _cleanup_sigkill_wait_ _cleanup_(sigkill_wait)
+
 int kill_and_sigcont(pid_t pid, int sig);
 pid_t get_parent_of_pid(pid_t pid, pid_t *ppid);
 void rename_process(const char name[8]);
index 2129d46aef1f2f4519ee91c0528599b3cc363a16..d5227aa6d0d68ab446e2e4e46973bf1e92fca98a 100644 (file)
@@ -4016,16 +4016,6 @@ int read_attr_path(const char *p, unsigned *ret) {
         return read_attr_fd(fd, ret);
 }
 
-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 syslog_parse_priority(const char **p, int *priority, bool with_facility) {
         int a = 0, b = 0, c = 0;
         int k;
index 55b428fa63f42d3f04f4906640025d46a3addce7..f32033767ae379ad1eeea762653f6b0ff2ed1711 100644 (file)
@@ -92,7 +92,6 @@ int parse_size(const char *t, uint64_t base, uint64_t *size);
 int parse_boolean(const char *v) _pure_;
 int parse_pid(const char *s, pid_t* ret_pid);
 
-
 int safe_atou(const char *s, unsigned *ret_u);
 int safe_atoi(const char *s, int *ret_i);
 
@@ -677,9 +676,6 @@ int read_attr_path(const char *p, unsigned *ret);
 
 #define RLIMIT_MAKE_CONST(lim) ((struct rlimit) { lim, lim })
 
-void sigkill_wait(pid_t *pid);
-#define _cleanup_sigkill_wait_ _cleanup_(sigkill_wait)
-
 int syslog_parse_priority(const char **p, int *priority, bool with_facility);
 
 int rename_noreplace(int olddirfd, const char *oldpath, int newdirfd, const char *newpath);