]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
process-util: rename get_parent_of_pid() → get_process_ppid()
authorLennart Poettering <lennart@poettering.net>
Tue, 27 Oct 2015 13:01:48 +0000 (14:01 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 27 Oct 2015 13:01:48 +0000 (14:01 +0100)
In order to match the other get_process_xyz() calls.

src/basic/process-util.c
src/basic/process-util.h
src/core/cgroup.c
src/core/service.c
src/test/test-process-util.c

index 31951cdd4fe309893c01386e0bbea65d4dc0fad4..0b7e3010e0693bf78fbe5712880ed9a6aaea69ed 100644 (file)
@@ -402,7 +402,7 @@ int get_process_environ(pid_t pid, char **env) {
         return 0;
 }
 
-int get_parent_of_pid(pid_t pid, pid_t *_ppid) {
+int get_process_ppid(pid_t pid, pid_t *_ppid) {
         int r;
         _cleanup_free_ char *line = NULL;
         long unsigned ppid;
index 31f760981e5ccc4f6d8da5f0ff38b1d3e3c37497..85fc8d8eb78be4835ae699df54ac957cc14c6182 100644 (file)
@@ -51,6 +51,7 @@ int get_process_capeff(pid_t pid, char **capeff);
 int get_process_cwd(pid_t pid, char **cwd);
 int get_process_root(pid_t pid, char **root);
 int get_process_environ(pid_t pid, char **environ);
+int get_process_ppid(pid_t pid, pid_t *ppid);
 
 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);
@@ -59,7 +60,6 @@ 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]);
 int is_kernel_thread(pid_t pid);
index 90cee12be755f4f04ac95fd3891951a6dd45b7de..70f6d4af0f74cd168c413dff13722160f71552e7 100644 (file)
@@ -1208,7 +1208,7 @@ int unit_search_main_pid(Unit *u, pid_t *ret) {
                         continue;
 
                 /* Ignore processes that aren't our kids */
-                if (get_parent_of_pid(npid, &ppid) >= 0 && ppid != mypid)
+                if (get_process_ppid(npid, &ppid) >= 0 && ppid != mypid)
                         continue;
 
                 if (pid != 0)
index 2d92799fec4c831a3b6e58eb9a11b5f978a51e82..31a0d3aebef40f4dcbe6d0adb1c891c590980aca 100644 (file)
@@ -175,7 +175,7 @@ static int service_set_main_pid(Service *s, pid_t pid) {
         s->main_pid = pid;
         s->main_pid_known = true;
 
-        if (get_parent_of_pid(pid, &ppid) >= 0 && ppid != getpid()) {
+        if (get_process_ppid(pid, &ppid) >= 0 && ppid != getpid()) {
                 log_unit_warning(UNIT(s), "Supervising process "PID_FMT" which is not our child. We'll most likely not notice when it exits.", pid);
                 s->main_pid_alien = true;
         } else
index fa448348da7b72527e734c3b106b8ab1a24ef510..48be5a3a87e5afd65f96339e2919c55be0a306de 100644 (file)
@@ -55,7 +55,7 @@ static void test_get_process_comm(void) {
         assert_se(get_process_cmdline(1, 8, false, &d) >= 0);
         log_info("pid1 cmdline truncated: '%s'", d);
 
-        assert_se(get_parent_of_pid(1, &e) >= 0);
+        assert_se(get_process_ppid(1, &e) >= 0);
         log_info("pid1 ppid: "PID_FMT, e);
         assert_se(e == 0);