chiark / gitweb /
journald: set SO_PASSEC only if selinux is enabled
[elogind.git] / src / umount.c
index 67be42ea337397b57ec3f045f0a8425765a2a526..0a63d23a01bb1b18ea2703237646c60a20792ce0 100644 (file)
@@ -410,7 +410,11 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
         assert(head);
 
         LIST_FOREACH_SAFE(mount_point, m, n, *head) {
-                if (streq(m->path, "/")) {
+                if (path_equal(m->path, "/")
+#ifndef HAVE_SPLIT_USR
+                    || path_equal(m->path, "/usr")
+#endif
+                ) {
                         n_failed++;
                         continue;
                 }
@@ -565,10 +569,13 @@ int umount_all(bool *changed) {
         /* retry umount, until nothing can be umounted anymore */
         do {
                 umount_changed = false;
-                r = mount_points_list_umount(&mp_list_head, &umount_changed, false);
+
+                mount_points_list_umount(&mp_list_head, &umount_changed, false);
                 if (umount_changed)
                         *changed = true;
-        } while(umount_changed);
+
+        } while (umount_changed);
+
         /* umount one more time with logging enabled */
         r = mount_points_list_umount(&mp_list_head, &umount_changed, true);
         if (r <= 0)