1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-20 18:04:03 +03:00

core: constify PidRef arguments

This commit is contained in:
Yu Watanabe 2024-01-24 13:54:45 +09:00
parent 269f70de78
commit d70dfe1b27
6 changed files with 14 additions and 14 deletions

View File

@ -4202,7 +4202,7 @@ Unit* manager_get_unit_by_cgroup(Manager *m, const char *cgroup) {
}
}
Unit *manager_get_unit_by_pidref_cgroup(Manager *m, PidRef *pid) {
Unit *manager_get_unit_by_pidref_cgroup(Manager *m, const PidRef *pid) {
_cleanup_free_ char *cgroup = NULL;
assert(m);
@ -4213,7 +4213,7 @@ Unit *manager_get_unit_by_pidref_cgroup(Manager *m, PidRef *pid) {
return manager_get_unit_by_cgroup(m, cgroup);
}
Unit *manager_get_unit_by_pidref_watching(Manager *m, PidRef *pid) {
Unit *manager_get_unit_by_pidref_watching(Manager *m, const PidRef *pid) {
Unit *u, **array;
assert(m);
@ -4232,7 +4232,7 @@ Unit *manager_get_unit_by_pidref_watching(Manager *m, PidRef *pid) {
return NULL;
}
Unit *manager_get_unit_by_pidref(Manager *m, PidRef *pid) {
Unit *manager_get_unit_by_pidref(Manager *m, const PidRef *pid) {
Unit *u;
assert(m);

View File

@ -375,9 +375,9 @@ void manager_shutdown_cgroup(Manager *m, bool delete);
unsigned manager_dispatch_cgroup_realize_queue(Manager *m);
Unit *manager_get_unit_by_cgroup(Manager *m, const char *cgroup);
Unit *manager_get_unit_by_pidref_cgroup(Manager *m, PidRef *pid);
Unit *manager_get_unit_by_pidref_watching(Manager *m, PidRef *pid);
Unit* manager_get_unit_by_pidref(Manager *m, PidRef *pid);
Unit *manager_get_unit_by_pidref_cgroup(Manager *m, const PidRef *pid);
Unit *manager_get_unit_by_pidref_watching(Manager *m, const PidRef *pid);
Unit* manager_get_unit_by_pidref(Manager *m, const PidRef *pid);
Unit* manager_get_unit_by_pid(Manager *m, pid_t pid);
uint64_t unit_get_ancestor_memory_min(Unit *u);

View File

@ -2405,7 +2405,7 @@ void manager_clear_jobs(Manager *m) {
job_finish_and_invalidate(j, JOB_CANCELED, false, false);
}
void manager_unwatch_pidref(Manager *m, PidRef *pid) {
void manager_unwatch_pidref(Manager *m, const PidRef *pid) {
assert(m);
for (;;) {

View File

@ -550,7 +550,7 @@ int manager_propagate_reload(Manager *m, Unit *unit, JobMode mode, sd_bus_error
void manager_clear_jobs(Manager *m);
void manager_unwatch_pidref(Manager *m, PidRef *pid);
void manager_unwatch_pidref(Manager *m, const PidRef *pid);
unsigned manager_dispatch_load_queue(Manager *m);

View File

@ -2788,7 +2788,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
}
}
int unit_watch_pidref(Unit *u, PidRef *pid, bool exclusive) {
int unit_watch_pidref(Unit *u, const PidRef *pid, bool exclusive) {
_cleanup_(pidref_freep) PidRef *pid_dup = NULL;
int r;
@ -2872,7 +2872,7 @@ int unit_watch_pid(Unit *u, pid_t pid, bool exclusive) {
return unit_watch_pidref(u, &pidref, exclusive);
}
void unit_unwatch_pidref(Unit *u, PidRef *pid) {
void unit_unwatch_pidref(Unit *u, const PidRef *pid) {
assert(u);
assert(pidref_is_set(pid));
@ -5910,7 +5910,7 @@ bool unit_needs_console(Unit *u) {
return exec_context_may_touch_console(ec);
}
int unit_pid_attachable(Unit *u, PidRef *pid, sd_bus_error *error) {
int unit_pid_attachable(Unit *u, const PidRef *pid, sd_bus_error *error) {
int r;
assert(u);

View File

@ -931,9 +931,9 @@ void unit_notify_cgroup_oom(Unit *u, bool managed_oom);
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_success);
int unit_watch_pidref(Unit *u, PidRef *pid, bool exclusive);
int unit_watch_pidref(Unit *u, const PidRef *pid, bool exclusive);
int unit_watch_pid(Unit *u, pid_t pid, bool exclusive);
void unit_unwatch_pidref(Unit *u, PidRef *pid);
void unit_unwatch_pidref(Unit *u, const PidRef *pid);
void unit_unwatch_pid(Unit *u, pid_t pid);
void unit_unwatch_all_pids(Unit *u);
@ -1055,7 +1055,7 @@ int unit_warn_leftover_processes(Unit *u, cg_kill_log_func_t log_func);
bool unit_needs_console(Unit *u);
int unit_pid_attachable(Unit *unit, PidRef *pid, sd_bus_error *error);
int unit_pid_attachable(Unit *unit, const PidRef *pid, sd_bus_error *error);
static inline bool unit_has_job_type(Unit *u, JobType type) {
return u && u->job && u->job->type == type;