free(path);
while ((de = readdir(d))) {
- Unit *other;
-
if (de->d_name[0] == '.')
continue;
continue;
}
- r = manager_load_unit(u->meta.manager, path, &other);
+ r = unit_add_dependency_by_name(u, UNIT_WANTS, path);
free(path);
if (r < 0) {
closedir(d);
return r;
}
-
- if ((r = unit_add_dependency(u, UNIT_WANTS, other)) < 0) {
- closedir(d);
- return r;
- }
}
closedir(d);
FOREACH_WORD(w, &l, rvalue, state) {
char *t;
int r;
- Unit *other;
if (!(t = strndup(w, l)))
return -ENOMEM;
- r = manager_load_unit(u->meta.manager, t, &other);
+ r = unit_add_dependency_by_name(u, d, t);
free(t);
if (r < 0)
return r;
-
- if ((r = unit_add_dependency(u, d, other)) < 0)
- return r;
}
return 0;