chiark / gitweb /
unit: rename BindTo= to BindsTo=
[elogind.git] / src / core / mount.c
index 5364b5dd7c34afe79401f2ff3afb8750aab2aa64..15d5f215303376c40a688f9c2dada51fdac2e591 100644 (file)
@@ -618,7 +618,11 @@ static int mount_load(Unit *u) {
         assert(u);
         assert(u->load_state == UNIT_STUB);
 
-        r = unit_load_fragment_and_dropin_optional(u);
+        if (m->from_proc_self_mountinfo)
+                r = unit_load_fragment_and_dropin_optional(u);
+        else
+                r = unit_load_fragment_and_dropin(u);
+
         if (r < 0)
                 return r;
 
@@ -683,8 +687,10 @@ static void mount_set_state(Mount *m, MountState state) {
                  state == MOUNT_REMOUNTING_SIGKILL ||
                  state == MOUNT_UNMOUNTING_SIGTERM ||
                  state == MOUNT_UNMOUNTING_SIGKILL ||
-                 state == MOUNT_FAILED)
-                mount_notify_automount(m, -ENODEV);
+                 state == MOUNT_FAILED) {
+               if (state != old_state)
+                       mount_notify_automount(m, -ENODEV);
+       }
 
         if (state != old_state)
                 log_debug("%s changed %s -> %s",
@@ -1436,6 +1442,14 @@ static int mount_add_one(
         } else {
                 delete = false;
                 free(e);
+
+                if (u->load_state == UNIT_ERROR) {
+                        u->load_state = UNIT_LOADED;
+                        u->load_error = 0;
+                        r = mount_add_extras(MOUNT(u));
+                        if (r < 0)
+                                goto fail;
+                }
         }
 
         if (!(w = strdup(what)) ||
@@ -1520,7 +1534,7 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
                         goto clean_up;
                 }
 
-                o = join(options, ",", options2, NULL);
+                o = strjoin(options, ",", options2, NULL);
                 if (!o) {
                         r = -ENOMEM;
                         goto finish;
@@ -1773,7 +1787,6 @@ static const char* const mount_result_table[_MOUNT_RESULT_MAX] = {
 DEFINE_STRING_TABLE_LOOKUP(mount_result, MountResult);
 
 const UnitVTable mount_vtable = {
-        .suffix = ".mount",
         .object_size = sizeof(Mount),
         .sections =
                 "Unit\0"