chiark / gitweb /
dbus: suppress duplicate and misleading messages
authorLennart Poettering <lennart@poettering.net>
Tue, 11 Mar 2014 03:10:19 +0000 (04:10 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 11 Mar 2014 03:19:59 +0000 (04:19 +0100)
When we try to send a signal on a connection we didn't hae the time to
process the Disconnected message yet, don't generate multiple warning
messages, but only a single debug message.

https://bugs.freedesktop.org/show_bug.cgi?id=75874

src/core/dbus-manager.c
src/core/dbus-unit.c

index 34ef1f5d29a9be6a8df773b81b30cd62ee225473..30f28b6e2cd6e8f3b561048ba49706ea09a87940 100644 (file)
@@ -1386,8 +1386,11 @@ static int reply_unit_file_changes_and_free(
         unsigned i;
         int r;
 
-        if (n_changes > 0)
-                bus_foreach_bus(m, NULL, send_unit_files_changed, NULL);
+        if (n_changes > 0) {
+                r = bus_foreach_bus(m, NULL, send_unit_files_changed, NULL);
+                if (r < 0)
+                        log_debug("Failed to send UnitFilesChanged signal: %s", strerror(-r));
+        }
 
         r = sd_bus_message_new_method_return(message, &reply);
         if (r < 0)
index 515ac8b78c2042cd240ce1edb24f0d34e2a7979a..07e7f20e6b185a7f92e8d45b779a3e6d565eb412 100644 (file)
@@ -638,21 +638,13 @@ static int send_changed_signal(sd_bus *bus, void *userdata) {
                         bus, p,
                         UNIT_VTABLE(u)->bus_interface,
                         NULL);
-        if (r < 0) {
-                log_warning("Failed to send out specific PropertiesChanged signal for %s: %s", u->id, strerror(-r));
+        if (r < 0)
                 return r;
-        }
 
-        r = sd_bus_emit_properties_changed_strv(
+        return sd_bus_emit_properties_changed_strv(
                         bus, p,
                         "org.freedesktop.systemd1.Unit",
                         NULL);
-        if (r < 0) {
-                log_warning("Failed to send out generic PropertiesChanged signal for %s: %s", u->id, strerror(-r));
-                return r;
-        }
-
-        return 0;
 }
 
 void bus_unit_send_change_signal(Unit *u) {