summaryrefslogtreecommitdiff
path: root/dbind
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2013-09-02 12:28:27 -0500
committerMike Gorse <mgorse@suse.com>2013-09-02 12:28:27 -0500
commitc40e7c6ce7f5686fa6f5765103727a6e69112c5a (patch)
treed58324f9c99f866d1b81061b2df6211afc462661 /dbind
parent45155e07cc40e4da0e75649441e6cf7804bc9b53 (diff)
downloadat-spi2-core-c40e7c6ce7f5686fa6f5765103727a6e69112c5a.tar.gz
Don't call dbus_connection_dispatch recursively
dbus_connection_dispatch is trying to lock the connection when it is already locked, resulting in a deadlock, so just don't call it recursively for now.
Diffstat (limited to 'dbind')
-rw-r--r--dbind/dbind.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/dbind/dbind.c b/dbind/dbind.c
index f10b9cd6..d85a9e5a 100644
--- a/dbind/dbind.c
+++ b/dbind/dbind.c
@@ -68,14 +68,19 @@ dbind_send_and_allow_reentry (DBusConnection * bus, DBusMessage * message, DBusE
const char *destination = dbus_message_get_destination (message);
struct timeval tv;
DBusMessage *ret;
+ static gboolean in_dispatch = FALSE;
if (unique_name && destination &&
strcmp (destination, unique_name) != 0)
{
ret = dbus_connection_send_with_reply_and_block (bus, message,
dbind_timeout, error);
- if (g_main_depth () == 0)
- while (dbus_connection_dispatch (bus) == DBUS_DISPATCH_DATA_REMAINS);
+ if (g_main_depth () == 0 && !in_dispatch)
+ {
+ in_dispatch = TRUE;
+ while (dbus_connection_dispatch (bus) == DBUS_DISPATCH_DATA_REMAINS);
+ in_dispatch = FALSE;
+ }
return ret;
}