daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
9fc0f6
From 3b321e8bb1548432624b374f7077f4aaaae40a2d Mon Sep 17 00:00:00 2001
9fc0f6
From: Lennart Poettering <lennart@poettering.net>
9fc0f6
Date: Wed, 26 Feb 2014 04:27:50 +0100
9fc0f6
Subject: [PATCH] mount: don't send out PropertiesChanged message if actually
9fc0f6
 nothing got changed
9fc0f6
9fc0f6
Conflicts:
9fc0f6
	src/core/mount.c
9fc0f6
---
9fc0f6
 src/core/mount.c | 15 ++++++++++++---
9fc0f6
 1 file changed, 12 insertions(+), 3 deletions(-)
9fc0f6
9fc0f6
diff --git a/src/core/mount.c b/src/core/mount.c
9fc0f6
index c0445a6..62ec7fe 100644
9fc0f6
--- a/src/core/mount.c
9fc0f6
+++ b/src/core/mount.c
9fc0f6
@@ -1414,7 +1414,7 @@ static int mount_add_one(
9fc0f6
                 bool set_flags) {
9fc0f6
         int r;
9fc0f6
         Unit *u;
9fc0f6
-        bool delete;
9fc0f6
+        bool delete, changed = false;;
9fc0f6
         char *e, *w = NULL, *o = NULL, *f = NULL;
9fc0f6
         MountParameters *p;
9fc0f6
         bool load_extras = false;
9fc0f6
@@ -1483,6 +1483,7 @@ static int mount_add_one(
9fc0f6
                 }
9fc0f6
 
9fc0f6
                 unit_add_to_load_queue(u);
9fc0f6
+                changed = true;
9fc0f6
         } else {
9fc0f6
                 delete = false;
9fc0f6
                 free(e);
9fc0f6
@@ -1502,6 +1503,7 @@ static int mount_add_one(
9fc0f6
                         /* Load in the extras later on, after we
9fc0f6
                          * finished initialization of the unit */
9fc0f6
                         load_extras = true;
9fc0f6
+                        changed = true;
9fc0f6
                 }
9fc0f6
         }
9fc0f6
 
9fc0f6
@@ -1513,10 +1515,16 @@ static int mount_add_one(
9fc0f6
         }
9fc0f6
 
9fc0f6
         p = &MOUNT(u)->parameters_proc_self_mountinfo;
9fc0f6
+
9fc0f6
+        changed = changed ||
9fc0f6
+                !streq_ptr(p->options, options) ||
9fc0f6
+                !streq_ptr(p->what, what) ||
9fc0f6
+                !streq_ptr(p->fstype, fstype);
9fc0f6
+
9fc0f6
         if (set_flags) {
9fc0f6
                 MOUNT(u)->is_mounted = true;
9fc0f6
                 MOUNT(u)->just_mounted = !MOUNT(u)->from_proc_self_mountinfo;
9fc0f6
-                MOUNT(u)->just_changed = !streq_ptr(p->options, o);
9fc0f6
+                MOUNT(u)->just_changed = changed;
9fc0f6
         }
9fc0f6
 
9fc0f6
         MOUNT(u)->from_proc_self_mountinfo = true;
9fc0f6
@@ -1538,7 +1546,8 @@ static int mount_add_one(
9fc0f6
                         goto fail;
9fc0f6
         }
9fc0f6
 
9fc0f6
-        unit_add_to_dbus_queue(u);
9fc0f6
+        if (changed)
9fc0f6
+                unit_add_to_dbus_queue(u);
9fc0f6
 
9fc0f6
         return 0;
9fc0f6