1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-26 17:27:41 +03:00

core/unit: use FOREACH_ARRAY at one more place

This commit is contained in:
Mike Yuan 2024-04-01 19:42:02 +08:00
parent 8959e17d73
commit 5e7022033f
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View File

@ -1249,10 +1249,10 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
if (!u->manager->prefix[dt]) if (!u->manager->prefix[dt])
continue; 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; _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) if (!p)
return -ENOMEM; return -ENOMEM;