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