summaryrefslogtreecommitdiffstats
path: root/src/core/execute.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-10-18 14:03:36 +0200
committerLennart Poettering <lennart@poettering.net>2023-10-18 14:03:36 +0200
commitd3eb74f8f844cf3dc7913d861070ffda66035933 (patch)
treea5db6cd76765a17f1f6df0ee472102598bed1f33 /src/core/execute.c
parentexecute: use close_many_and_free() more (diff)
downloadsystemd-d3eb74f8f844cf3dc7913d861070ffda66035933.tar.xz
systemd-d3eb74f8f844cf3dc7913d861070ffda66035933.zip
fd-util: add new helper close_many_unset()
Diffstat (limited to '')
-rw-r--r--src/core/execute.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index ce947a7a52..46fb8805b3 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -2251,8 +2251,7 @@ void exec_params_serialized_done(ExecParameters *p) {
if (!p)
return;
- for (size_t i = 0; p->fds && i < p->n_socket_fds + p->n_storage_fds; i++)
- p->fds[i] = safe_close(p->fds[i]);
+ close_many_unset(p->fds, p->n_socket_fds + p->n_storage_fds);
p->cgroup_path = mfree(p->cgroup_path);