aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-10-23 21:04:19 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-10-23 21:04:19 -0500
commit40b4288ef38837a17321d0273c26befe7c8c89b0 (patch)
treea154818063b0a5091ecda30c09871d0e69443c59
parentde955883dad3e19fd32c62e0e26294fff05a3cc8 (diff)
downloadlibayatana-indicator-40b4288ef38837a17321d0273c26befe7c8c89b0.tar.gz
libayatana-indicator-40b4288ef38837a17321d0273c26befe7c8c89b0.tar.bz2
libayatana-indicator-40b4288ef38837a17321d0273c26befe7c8c89b0.zip
When we can't get a handle to the system bus, exit gracefully instead of crashing.
-rw-r--r--libindicator/indicator-service.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c
index 11171fc..18c87fc 100644
--- a/libindicator/indicator-service.c
+++ b/libindicator/indicator-service.c
@@ -25,6 +25,8 @@ License along with this library. If not, see
#include "config.h"
#endif
+#include <stdlib.h> /* exit() */
+
#include <gio/gio.h>
#include "indicator-service.h"
@@ -361,8 +363,9 @@ bus_get_cb (GObject * object, GAsyncResult * res, gpointer user_data)
GDBusConnection * connection = g_bus_get_finish(res, &error);
if (error != NULL) {
- g_error("OMG! Unable to get a connection to DBus: %s", error->message);
+ g_warning("Unable to get a connection to the session DBus: %s", error->message);
g_error_free(error);
+ exit (0);
return;
}