mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-12 09:17:44 +03:00
core: manager_set_exec_params() cannot fail, hence make it void
Let's simplify things a bit.
This commit is contained in:
parent
584b8688d1
commit
19bbdd985e
@ -3413,7 +3413,7 @@ Set *manager_get_units_requiring_mounts_for(Manager *m, const char *path) {
|
||||
return hashmap_get(m->units_requiring_mounts_for, streq(p, "/") ? "" : p);
|
||||
}
|
||||
|
||||
int manager_set_exec_params(Manager *m, ExecParameters *p) {
|
||||
void manager_set_exec_params(Manager *m, ExecParameters *p) {
|
||||
assert(m);
|
||||
assert(p);
|
||||
|
||||
@ -3423,8 +3423,6 @@ int manager_set_exec_params(Manager *m, ExecParameters *p) {
|
||||
p->prefix = m->prefix;
|
||||
|
||||
SET_FLAG(p->flags, EXEC_PASS_LOG_UNIT|EXEC_CHOWN_DIRECTORIES, MANAGER_IS_SYSTEM(m));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int manager_update_failed_units(Manager *m, Unit *u, bool failed) {
|
||||
|
@ -384,7 +384,7 @@ void manager_flip_auto_status(Manager *m, bool enable);
|
||||
|
||||
Set *manager_get_units_requiring_mounts_for(Manager *m, const char *path);
|
||||
|
||||
int manager_set_exec_params(Manager *m, ExecParameters *p);
|
||||
void manager_set_exec_params(Manager *m, ExecParameters *p);
|
||||
|
||||
ManagerState manager_state(Manager *m);
|
||||
|
||||
|
@ -770,9 +770,7 @@ static int mount_spawn(Mount *m, ExecCommand *c, pid_t *_pid) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = manager_set_exec_params(UNIT(m)->manager, &exec_params);
|
||||
if (r < 0)
|
||||
return r;
|
||||
manager_set_exec_params(UNIT(m)->manager, &exec_params);
|
||||
|
||||
exec_params.cgroup_path = UNIT(m)->cgroup_path;
|
||||
SET_FLAG(exec_params.flags, EXEC_CGROUP_DELEGATE, m->cgroup_context.delegate);
|
||||
|
@ -1344,9 +1344,7 @@ static int service_spawn(
|
||||
}
|
||||
}
|
||||
|
||||
r = manager_set_exec_params(UNIT(s)->manager, &exec_params);
|
||||
if (r < 0)
|
||||
return r;
|
||||
manager_set_exec_params(UNIT(s)->manager, &exec_params);
|
||||
|
||||
final_env = strv_env_merge(2, exec_params.environment, our_env, NULL);
|
||||
if (!final_env)
|
||||
|
@ -1790,9 +1790,7 @@ static int socket_spawn(Socket *s, ExecCommand *c, pid_t *_pid) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = manager_set_exec_params(UNIT(s)->manager, &exec_params);
|
||||
if (r < 0)
|
||||
return r;
|
||||
manager_set_exec_params(UNIT(s)->manager, &exec_params);
|
||||
|
||||
exec_params.argv = c->argv;
|
||||
exec_params.cgroup_path = UNIT(s)->cgroup_path;
|
||||
|
@ -636,9 +636,7 @@ static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) {
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
|
||||
r = manager_set_exec_params(UNIT(s)->manager, &exec_params);
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
manager_set_exec_params(UNIT(s)->manager, &exec_params);
|
||||
|
||||
exec_params.cgroup_path = UNIT(s)->cgroup_path;
|
||||
SET_FLAG(exec_params.flags, EXEC_CGROUP_DELEGATE, s->cgroup_context.delegate);
|
||||
|
Loading…
Reference in New Issue
Block a user