chiark / gitweb /
errno is positive
[elogind.git] / src / shared / dbus-common.c
index 2769b2c882e2081a153934c56cdfba46b1d5514f..5afce7627ae7db87b6b3ff33752cc3c3f9d1240e 100644 (file)
@@ -717,9 +717,14 @@ dbus_bool_t bus_maybe_send_reply (DBusConnection   *c,
                                   DBusMessage *message,
                                   DBusMessage *reply)
 {
-        if (dbus_message_get_no_reply (message))
+        /* Some parts of systemd "reply" to signals, which of course
+         * have the no-reply flag set.  We will be defensive here and
+         * still send out a reply if we're passed a signal.
+         */
+        if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL &&
+            dbus_message_get_no_reply(message))
                 return TRUE;
-        return dbus_connection_send (c, reply, NULL);
+        return dbus_connection_send(c, reply, NULL);
 }
 
 DBusHandlerResult bus_send_error_reply(DBusConnection *c, DBusMessage *message, DBusError *berror, int error) {
@@ -1092,7 +1097,7 @@ int generic_print_property(const char *name, DBusMessageIter *iter, bool all) {
                 } else if (strstr(name, "USec")) {
                         char timespan[FORMAT_TIMESPAN_MAX];
 
-                        printf("%s=%s\n", name, format_timespan(timespan, sizeof(timespan), u));
+                        printf("%s=%s\n", name, format_timespan(timespan, sizeof(timespan), u, 0));
                 } else
                         printf("%s=%llu\n", name, (unsigned long long) u);