return -ENOENT;
}
+ i->path = filename;
+
+ if ((r = config_parse(filename, f, NULL, items, true, i)) < 0) {
+ fclose(f);
+ return r;
+ }
+
/* Consider unit files stored in /lib and /usr always enabled
* if they have no [Install] data. */
if (streq(verb, "is-enabled") &&
!path_startswith(filename, "/etc"))
return 1;
- i->path = filename;
-
- if ((r = config_parse(filename, f, NULL, items, true, i)) < 0) {
- fclose(f);
- return r;
- }
-
n_symlinks += strv_length(i->aliases);
n_symlinks += strv_length(i->wanted_by);