aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-10-24 02:16:34 +0000
committerTarmac <Unknown>2013-10-24 02:16:34 +0000
commitda34f0cbe9eb05dcaf25fc0a502b4ae15d40ae27 (patch)
tree7eb6572c8053d0bce1c4900d0c6fafed0f6d0752
parentfe77f0ec399ec462cef43f98cbcb95d97edfa361 (diff)
parent5e409a479788424ca879c95fc588fc7085291704 (diff)
downloadayatana-indicator-application-da34f0cbe9eb05dcaf25fc0a502b4ae15d40ae27.tar.gz
ayatana-indicator-application-da34f0cbe9eb05dcaf25fc0a502b4ae15d40ae27.tar.bz2
ayatana-indicator-application-da34f0cbe9eb05dcaf25fc0a502b4ae15d40ae27.zip
When we can't get a handle to the system bus, exit gracefully instead of crashing. Fixes: https://bugs.launchpad.net/bugs/1197788.
Approved by PS Jenkins bot, Lars Uebernickel.
-rw-r--r--src/application-service-watcher.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c
index edbf05b..006f3aa 100644
--- a/src/application-service-watcher.c
+++ b/src/application-service-watcher.c
@@ -24,6 +24,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config.h"
#endif
+#include <stdlib.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <dbus/dbus-glib-bindings.h>
@@ -158,8 +159,9 @@ application_service_watcher_init (ApplicationServiceWatcher *self)
GError * error = NULL;
DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
if (error != NULL) {
- g_error("Unable to get session bus: %s", error->message);
+ g_warning("Unable to get session bus: %s", error->message);
g_error_free(error);
+ exit(0);
return;
}