]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
tests: work with older dbus
authorEric Blake <eblake@redhat.com>
Thu, 8 Aug 2013 19:00:03 +0000 (13:00 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 8 Aug 2013 22:33:55 +0000 (16:33 -0600)
On RHEL 5, with dbus 1.1.2, compilation failed with:

virsystemdmock.c: In function 'dbus_connection_send_with_reply_and_block':
virsystemdmock.c:68: warning: implicit declaration of function 'dbus_message_set_serial'

Fix this by instead bypassing all attempts to use a dbus serial.

* tests/virsystemdmock.c (dbus_message_set_reply_serial): Add new
override.
(dbus_connection_send_with_reply_and_block): No longer bother with
the serial.

Signed-off-by: Eric Blake <eblake@redhat.com>
tests/virsystemdmock.c

index b6c36950f85a116dc634de4aaf5a6ff8d5856f3c..ded52d299829a25be4288b33f55ab38c68965972 100644 (file)
@@ -58,6 +58,12 @@ dbus_bool_t dbus_connection_set_watch_functions(DBusConnection *connection ATTRI
     return 1;
 }
 
+dbus_bool_t dbus_message_set_reply_serial(DBusMessage *message ATTRIBUTE_UNUSED,
+                                          dbus_uint32_t serial ATTRIBUTE_UNUSED)
+{
+    return 1;
+}
+
 DBusMessage *dbus_connection_send_with_reply_and_block(DBusConnection *connection ATTRIBUTE_UNUSED,
                                                        DBusMessage *message,
                                                        int timeout_milliseconds ATTRIBUTE_UNUSED,
@@ -65,8 +71,6 @@ DBusMessage *dbus_connection_send_with_reply_and_block(DBusConnection *connectio
 {
     DBusMessage *reply = NULL;
 
-    dbus_message_set_serial(message, 7);
-
     if (getenv("FAIL_BAD_SERVICE"))
         reply = dbus_message_new_error(message,
                                        "org.freedesktop.systemd.badthing",