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