- LIST_FOREACH(units_per_type, other, a->meta.manager->units_per_type[UNIT_MOUNT])
- if ((r = automount_add_one_mount_link(a, (Mount*) other)) < 0)
+ LIST_FOREACH(units_by_type, other, UNIT(a)->manager->units_by_type[UNIT_MOUNT])
+ if ((r = automount_add_one_mount_link(a, MOUNT(other))) < 0)
+ return r;
+
+ return 0;
+}
+
+static int automount_add_default_dependencies(Automount *a) {
+ int r;
+
+ assert(a);
+
+ if (UNIT(a)->manager->running_as == MANAGER_SYSTEM) {
+
+ if ((r = unit_add_dependency_by_name(UNIT(a), UNIT_BEFORE, SPECIAL_BASIC_TARGET, NULL, true)) < 0)