mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 03:25:31 +03:00
process-util: rename get_parent_of_pid() → get_process_ppid()
In order to match the other get_process_xyz() calls.
This commit is contained in:
parent
405f8907b9
commit
6bc73acb01
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user