From 5e7022033feddc6816eecb16f9726521392a6410 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Mon, 1 Apr 2024 19:42:02 +0800 Subject: [PATCH 1/2] core/unit: use FOREACH_ARRAY at one more place --- src/core/unit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/unit.c b/src/core/unit.c index bfb241573a7..f26c1c248ee 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -1249,10 +1249,10 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) { if (!u->manager->prefix[dt]) continue; - for (size_t i = 0; i < c->directories[dt].n_items; i++) { + FOREACH_ARRAY(i, c->directories[dt].items, c->directories[dt].n_items) { _cleanup_free_ char *p = NULL; - p = path_join(u->manager->prefix[dt], c->directories[dt].items[i].path); + p = path_join(u->manager->prefix[dt], i->path); if (!p) return -ENOMEM; From 4f156b1078adc12a90b1895149dfcff09f2451ce Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Mon, 1 Apr 2024 19:44:51 +0800 Subject: [PATCH 2/2] units: remove implicit RequiresMountsFor= --- units/systemd-networkd-persistent-storage.service | 1 - 1 file changed, 1 deletion(-) diff --git a/units/systemd-networkd-persistent-storage.service b/units/systemd-networkd-persistent-storage.service index c151d362855..5db29365478 100644 --- a/units/systemd-networkd-persistent-storage.service +++ b/units/systemd-networkd-persistent-storage.service @@ -15,7 +15,6 @@ DefaultDependencies=no After=systemd-remount-fs.service systemd-networkd.service BindsTo=systemd-networkd.service Conflicts=shutdown.target -RequiresMountsFor=/var/lib/systemd/network ConditionPathExists=!/etc/initrd-release [Service]