|
Bastien Nocera |
af52880 |
From 7a04aebc85d20b9c31850b5615f040ec208134c3 Mon Sep 17 00:00:00 2001
|
|
Bastien Nocera |
af52880 |
From: Mike Gorse <mgorse@novell.com>
|
|
Bastien Nocera |
af52880 |
Date: Sun, 6 Feb 2011 13:57:55 -0600
|
|
Bastien Nocera |
af52880 |
Subject: [PATCH 1/2] Fix for BGO#641338: Gracefully handle errors listening to dbus server for p2p
|
|
Bastien Nocera |
af52880 |
|
|
Bastien Nocera |
af52880 |
---
|
|
Bastien Nocera |
af52880 |
atk-adaptor/bridge.c | 10 ++++++++--
|
|
Bastien Nocera |
af52880 |
atk-adaptor/event.c | 5 +++--
|
|
Bastien Nocera |
af52880 |
po/POTFILES.in | 1 +
|
|
Bastien Nocera |
af52880 |
3 files changed, 12 insertions(+), 4 deletions(-)
|
|
Bastien Nocera |
af52880 |
|
|
Bastien Nocera |
af52880 |
diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c
|
|
Bastien Nocera |
af52880 |
index e856c82..0baf6f8 100644
|
|
Bastien Nocera |
af52880 |
--- a/atk-adaptor/bridge.c
|
|
Bastien Nocera |
af52880 |
+++ b/atk-adaptor/bridge.c
|
|
Bastien Nocera |
af52880 |
@@ -37,6 +37,7 @@
|
|
Bastien Nocera |
af52880 |
|
|
Bastien Nocera |
af52880 |
#include <droute/droute.h>
|
|
Bastien Nocera |
af52880 |
#include <gmodule.h>
|
|
Bastien Nocera |
af52880 |
+#include <glib/gi18n.h>
|
|
Bastien Nocera |
af52880 |
|
|
Bastien Nocera |
af52880 |
#include "bridge.h"
|
|
Bastien Nocera |
af52880 |
#include "event.h"
|
|
Bastien Nocera |
af52880 |
@@ -527,10 +528,15 @@ setup_bus (void)
|
|
Bastien Nocera |
af52880 |
|
|
Bastien Nocera |
af52880 |
dbus_error_init(&err;;
|
|
Bastien Nocera |
af52880 |
server = dbus_server_listen(spi_global_app_data->app_bus_addr, &err;;
|
|
Bastien Nocera |
af52880 |
-
|
|
Bastien Nocera |
af52880 |
- /* is there a better way to handle this */
|
|
Bastien Nocera |
af52880 |
if (server == NULL)
|
|
Bastien Nocera |
af52880 |
+ {
|
|
Bastien Nocera |
af52880 |
+ g_warning (_("atk-bridge: Couldn't listen on dbus server: %s"), err.message);
|
|
Bastien Nocera |
af52880 |
+ dbus_error_init (&err;;
|
|
Bastien Nocera |
af52880 |
+ spi_global_app_data->app_bus_addr [0] = '\0';
|
|
Bastien Nocera |
af52880 |
+ g_main_context_unref (spi_global_app_data->main_context);
|
|
Bastien Nocera |
af52880 |
+ spi_global_app_data->main_context = NULL;
|
|
Bastien Nocera |
af52880 |
return -1;
|
|
Bastien Nocera |
af52880 |
+ }
|
|
Bastien Nocera |
af52880 |
|
|
Bastien Nocera |
af52880 |
dbus_server_setup_with_g_main(server, NULL);
|
|
Bastien Nocera |
af52880 |
dbus_server_set_new_connection_function(server, new_connection_cb, NULL, NULL);
|
|
Bastien Nocera |
af52880 |
diff --git a/atk-adaptor/event.c b/atk-adaptor/event.c
|
|
Bastien Nocera |
af52880 |
index cc1877a..81a0f34 100644
|
|
Bastien Nocera |
af52880 |
--- a/atk-adaptor/event.c
|
|
Bastien Nocera |
af52880 |
+++ b/atk-adaptor/event.c
|
|
Bastien Nocera |
af52880 |
@@ -55,15 +55,16 @@ typedef struct _SpiReentrantCallClosure
|
|
Bastien Nocera |
af52880 |
static void
|
|
Bastien Nocera |
af52880 |
switch_main_context (GMainContext *cnx)
|
|
Bastien Nocera |
af52880 |
{
|
|
Bastien Nocera |
af52880 |
-#ifndef DISABLE_P2P
|
|
Bastien Nocera |
af52880 |
/* This code won't work on dbus-glib earlier than 0.9.0 because of FDO#30574 */
|
|
Bastien Nocera |
af52880 |
+ if (spi_global_app_data->app_bus_addr [0] == '\0')
|
|
Bastien Nocera |
af52880 |
+ return;
|
|
Bastien Nocera |
af52880 |
+
|
|
Bastien Nocera |
af52880 |
GList *list;
|
|
Bastien Nocera |
af52880 |
|
|
Bastien Nocera |
af52880 |
dbus_server_setup_with_g_main (spi_global_app_data->server, cnx);
|
|
Bastien Nocera |
af52880 |
dbus_connection_setup_with_g_main (spi_global_app_data->bus, cnx);
|
|
Bastien Nocera |
af52880 |
for (list = spi_global_app_data->direct_connections; list; list = list->next)
|
|
Bastien Nocera |
af52880 |
dbus_connection_setup_with_g_main (list->data, cnx);
|
|
Bastien Nocera |
af52880 |
-#endif
|
|
Bastien Nocera |
af52880 |
}
|
|
Bastien Nocera |
af52880 |
|
|
Bastien Nocera |
af52880 |
static void
|
|
Bastien Nocera |
af52880 |
diff --git a/po/POTFILES.in b/po/POTFILES.in
|
|
Bastien Nocera |
af52880 |
index ebb0efe..2d9aefd 100644
|
|
Bastien Nocera |
af52880 |
--- a/po/POTFILES.in
|
|
Bastien Nocera |
af52880 |
+++ b/po/POTFILES.in
|
|
Bastien Nocera |
af52880 |
@@ -1,3 +1,4 @@
|
|
Bastien Nocera |
af52880 |
# List of source files containing translatable strings.
|
|
Bastien Nocera |
af52880 |
# Please keep this file sorted alphabetically.
|
|
Bastien Nocera |
af52880 |
at-spi2.schemas.in
|
|
Bastien Nocera |
af52880 |
+atk-adaptor/bridge.c
|
|
Bastien Nocera |
af52880 |
--
|
|
Bastien Nocera |
af52880 |
1.7.4
|
|
Bastien Nocera |
af52880 |
|