GDBusConnection: don't pass boolean > 1 to _g_dbus_worker_new
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 22 Nov 2011 12:39:54 +0000 (12:39 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 22 Nov 2011 16:08:14 +0000 (16:08 +0000)
This happens to work at the moment (because GDBusWorker.frozen is a
gboolean and not just a 1-bit bitfield), but isn't right: the gboolean
ends up with values 0 or G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING
(which is more than 1).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=664558
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Zeuthen <davidz@redhat.com>
gio/gdbusconnection.c

index a6cf3df..b214fff 100644 (file)
@@ -2616,7 +2616,7 @@ initable_init (GInitable     *initable,
 
   connection->worker = _g_dbus_worker_new (connection->stream,
                                            connection->capabilities,
-                                           (connection->flags & G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING),
+                                           ((connection->flags & G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING) != 0),
                                            on_worker_message_received,
                                            on_worker_message_about_to_be_sent,
                                            on_worker_closed,