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