core: use PidRef in exec_spawn

This commit is contained in:
Luca Boccassi
2024-02-01 21:06:14 +00:00
committed by Luca Boccassi
parent 7a87d01f28
commit 556d2bc4a1
8 changed files with 17 additions and 38 deletions
+1 -6
View File
@@ -1879,7 +1879,6 @@ static int socket_spawn(Socket *s, ExecCommand *c, PidRef *ret_pid) {
_cleanup_(exec_params_shallow_clear) ExecParameters exec_params = EXEC_PARAMETERS_INIT(
EXEC_APPLY_SANDBOXING|EXEC_APPLY_CHROOT|EXEC_APPLY_TTY_STDIN);
_cleanup_(pidref_done) PidRef pidref = PIDREF_NULL;
pid_t pid;
int r;
assert(s);
@@ -1904,11 +1903,7 @@ static int socket_spawn(Socket *s, ExecCommand *c, PidRef *ret_pid) {
&exec_params,
s->exec_runtime,
&s->cgroup_context,
&pid);
if (r < 0)
return r;
r = pidref_set_pid(&pidref, pid);
&pidref);
if (r < 0)
return r;