diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-08-19 15:25:57 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2013-09-10 19:05:16 -0700 |
commit | 0eb3f19d3ffe3706f5c493e117ffba71df909a61 (patch) | |
tree | cf6e1ce627f87dc6f28cffa9f77c227a57fef2b8 | |
parent | 959da7f62867580d184312195f038edd203ee069 (diff) | |
download | pacrunner-0eb3f19d3ffe3706f5c493e117ffba71df909a61.tar.gz |
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.h | 3 | ||||
-rw-r--r-- | gdbus/object.c | 11 |
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) |