[gnome-session] main: fail if we can't get a connection to the session bus
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session] main: fail if we can't get a connection to the session bus
- Date: Mon, 4 Jun 2012 22:39:00 +0000 (UTC)
commit fea0dafe9a8db4fed50db0cf9a27db94d4fb45cd
Author: Ray Strode <rstrode redhat com>
Date: Mon Jun 4 18:27:39 2012 -0400
main: fail if we can't get a connection to the session bus
Right now we try to keep on chugging, but that's in vain.
It's better to just fail whale.
https://bugzilla.gnome.org/show_bug.cgi?id=608409
gnome-session/main.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gnome-session/main.c b/gnome-session/main.c
index 7a648ab..b2c147f 100644
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -141,7 +141,7 @@ acquire_name (void)
gsm_util_init_error (TRUE,
"Could not connect to session bus: %s",
error->message);
- /* not reached */
+ return FALSE;
}
bus_proxy = dbus_g_proxy_new_for_name_owner (connection,
@@ -153,7 +153,7 @@ acquire_name (void)
gsm_util_init_error (TRUE,
"Could not connect to session bus: %s",
error->message);
- /* not reached */
+ return FALSE;
}
g_signal_connect_swapped (bus_proxy,
@@ -165,7 +165,7 @@ acquire_name (void)
gsm_util_init_error (TRUE,
"%s",
"Could not acquire name on session bus");
- /* not reached */
+ return FALSE;
}
return TRUE;
@@ -351,7 +351,11 @@ main (int argc, char **argv)
xsmp_server = gsm_xsmp_server_new (client_store);
- acquire_name ();
+ if (!acquire_name ()) {
+ gsm_fail_whale_dialog_we_failed (TRUE, TRUE, NULL);
+ gtk_main ();
+ exit (1);
+ }
manager = gsm_manager_new (client_store, failsafe);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]