summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-08-19 15:25:57 +0300
committerMarcel Holtmann <marcel@holtmann.org>2013-09-10 19:06:59 -0700
commitfe5a8b18d258ef2468b7d6aee06b6e867980d80d (patch)
treefc684c50d2b07fa90a6619d1c45330b3fd8b68bc
parent12d103ef611f4892f7ee94b4ee4df6713d7199d0 (diff)
downloadneard-fe5a8b18d258ef2468b7d6aee06b6e867980d80d.tar.gz
neard-fe5a8b18d258ef2468b7d6aee06b6e867980d80d.tar.bz2
neard-fe5a8b18d258ef2468b7d6aee06b6e867980d80d.zip
gdbus: Add g_dbus_send_message_with_reply
g_dbus_send_message_with_reply flushes pending signals before calling dbus_connection_send_with_reply so it does not alter the message order
-rw-r--r--gdbus/gdbus.h3
-rw-r--r--gdbus/object.c11
2 files changed, 14 insertions, 0 deletions
diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index 8b13393..9542109 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -250,6 +250,9 @@ DBusMessage *g_dbus_create_reply_valist(DBusMessage *message,
int type, va_list args);
gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message);
+gboolean g_dbus_send_message_with_reply(DBusConnection *connection,
+ DBusMessage *message,
+ DBusPendingCall **call, int timeout);
gboolean g_dbus_send_error(DBusConnection *connection, DBusMessage *message,
const char *name, const char *format, ...)
__attribute__((format(printf, 4, 5)));
diff --git a/gdbus/object.c b/gdbus/object.c
index 83fc4e6..773128c 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -1556,6 +1556,17 @@ out:
return result;
}
+gboolean g_dbus_send_message_with_reply(DBusConnection *connection,
+ DBusMessage *message,
+ DBusPendingCall **call, int timeout)
+{
+ /* Flush pending signal to guarantee message order */
+ g_dbus_flush(connection);
+
+ return dbus_connection_send_with_reply(connection, message, call,
+ timeout);
+}
+
gboolean g_dbus_send_error_valist(DBusConnection *connection,
DBusMessage *message, const char *name,
const char *format, va_list args)