diff options
Diffstat (limited to 'src/core/execute-serialize.c')
-rw-r--r-- | src/core/execute-serialize.c | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/src/core/execute-serialize.c b/src/core/execute-serialize.c index 60c121a0d1..56c4f4da8a 100644 --- a/src/core/execute-serialize.c +++ b/src/core/execute-serialize.c @@ -1274,11 +1274,9 @@ static int exec_parameters_serialize(const ExecParameters *p, const ExecContext return r; } - if (p->n_socket_fds + p->n_storage_fds > 0) { - r = serialize_fd_many(f, fds, "exec-parameters-fds", p->fds, p->n_socket_fds + p->n_storage_fds); - if (r < 0) - return r; - } + r = serialize_fd_many(f, fds, "exec-parameters-fds", p->fds, p->n_socket_fds + p->n_storage_fds); + if (r < 0) + return r; } r = serialize_strv(f, "exec-parameters-fd-names", p->fd_names); @@ -1351,31 +1349,23 @@ static int exec_parameters_serialize(const ExecParameters *p, const ExecContext return r; } - if (p->stdin_fd >= 0) { - r = serialize_fd(f, fds, "exec-parameters-stdin-fd", p->stdin_fd); - if (r < 0) - return r; - } + r = serialize_fd(f, fds, "exec-parameters-stdin-fd", p->stdin_fd); + if (r < 0) + return r; - if (p->stdout_fd >= 0) { - r = serialize_fd(f, fds, "exec-parameters-stdout-fd", p->stdout_fd); - if (r < 0) - return r; - } + r = serialize_fd(f, fds, "exec-parameters-stdout-fd", p->stdout_fd); + if (r < 0) + return r; - if (p->stderr_fd >= 0) { - r = serialize_fd(f, fds, "exec-parameters-stderr-fd", p->stderr_fd); - if (r < 0) - return r; - } + r = serialize_fd(f, fds, "exec-parameters-stderr-fd", p->stderr_fd); + if (r < 0) + return r; - if (p->exec_fd >= 0) { - r = serialize_fd(f, fds, "exec-parameters-exec-fd", p->exec_fd); - if (r < 0) - return r; - } + r = serialize_fd(f, fds, "exec-parameters-exec-fd", p->exec_fd); + if (r < 0) + return r; - if (c && exec_context_restrict_filesystems_set(c) && p->bpf_outer_map_fd >= 0) { + if (c && exec_context_restrict_filesystems_set(c)) { r = serialize_fd(f, fds, "exec-parameters-bpf-outer-map-fd", p->bpf_outer_map_fd); if (r < 0) return r; @@ -1401,11 +1391,9 @@ static int exec_parameters_serialize(const ExecParameters *p, const ExecContext if (r < 0) return r; - if (p->user_lookup_fd >= 0) { - r = serialize_fd(f, fds, "exec-parameters-user-lookup-fd", p->user_lookup_fd); - if (r < 0) - return r; - } + r = serialize_fd(f, fds, "exec-parameters-user-lookup-fd", p->user_lookup_fd); + if (r < 0) + return r; r = serialize_strv(f, "exec-parameters-files-env", p->files_env); if (r < 0) |