chiark / gitweb /
unit: set default working directory to the user's home directory when running in...
[elogind.git] / src / core / mount.c
index 69cb6e24e4b23861b07ea8664de3c7befb889afa..a88b255875203caa8b16b83a0704fb57ea33a403 100644 (file)
@@ -631,6 +631,10 @@ static int mount_load(Unit *u) {
                 r = mount_add_extras(m);
                 if (r < 0)
                         return r;
+
+                r = unit_patch_working_directory(UNIT(m), &m->exec_context);
+                if (r < 0)
+                        return r;
         }
 
         return mount_verify(m);
@@ -687,8 +691,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",
@@ -1532,7 +1538,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;