summaryrefslogtreecommitdiff
path: root/src/dbus.c
diff options
context:
space:
mode:
authorZhang zhengguang <zhengguang.zhang@intel.com>2014-10-29 11:03:47 +0800
committerZhang zhengguang <zhengguang.zhang@intel.com>2014-10-29 11:03:47 +0800
commitbcae74da8fa2958b3fec9153fc33e41f0e0317bf (patch)
tree06a00f6457307467fee4f6580dce4a1a857751c1 /src/dbus.c
parent1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7 (diff)
downloadconnman-bcae74da8fa2958b3fec9153fc33e41f0e0317bf.tar.gz
connman-bcae74da8fa2958b3fec9153fc33e41f0e0317bf.tar.bz2
connman-bcae74da8fa2958b3fec9153fc33e41f0e0317bf.zip
Imported Upstream version 1.26upstream/1.26
Diffstat (limited to 'src/dbus.c')
-rw-r--r--src/dbus.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/dbus.c b/src/dbus.c
index 4fa0b362..d80a46ce 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -653,6 +653,38 @@ err:
return err;
}
+void connman_dbus_reply_pending(DBusMessage *pending,
+ int error, const char *path)
+{
+ if (pending) {
+ if (error > 0) {
+ DBusMessage *reply;
+
+ reply = __connman_error_failed(pending, error);
+ if (reply)
+ g_dbus_send_message(connection, reply);
+ } else {
+ const char *sender;
+
+ sender = dbus_message_get_interface(pending);
+ if (!path)
+ path = dbus_message_get_path(pending);
+
+ DBG("sender %s path %s", sender, path);
+
+ if (g_strcmp0(sender, CONNMAN_MANAGER_INTERFACE) == 0)
+ g_dbus_send_reply(connection, pending,
+ DBUS_TYPE_OBJECT_PATH, &path,
+ DBUS_TYPE_INVALID);
+ else
+ g_dbus_send_reply(connection, pending,
+ DBUS_TYPE_INVALID);
+ }
+
+ dbus_message_unref(pending);
+ }
+}
+
DBusConnection *connman_dbus_get_connection(void)
{
if (!connection)