summaryrefslogtreecommitdiff
path: root/fmrx-cat.c
diff options
context:
space:
mode:
Diffstat (limited to 'fmrx-cat.c')
-rw-r--r--fmrx-cat.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fmrx-cat.c b/fmrx-cat.c
index 580203e..c22d039 100644
--- a/fmrx-cat.c
+++ b/fmrx-cat.c
@@ -59,10 +59,15 @@ static void connect()
dbus_error_init(&err);
reply = dbus_connection_send_with_reply_and_block(bus, msg, -1, &err);
- g_assert(reply != NULL);
- g_assert(!dbus_error_is_set(&err));
dbus_message_unref(msg);
+ if (!reply) {
+ g_assert(dbus_error_is_set(&err));
+ g_printerr("Server error: %s", err.message);
+ dbus_error_free(&err);
+ return;
+ }
+
ret = dbus_message_get_args(reply, &err, DBUS_TYPE_UNIX_FD, &fd, DBUS_TYPE_INVALID);
g_assert(ret == TRUE);
g_assert(!dbus_error_is_set(&err));
@@ -74,7 +79,7 @@ static void connect()
static void dbus_init()
{
DBusError err; dbus_error_init(&err);
- bus = dbus_bus_get(DBUS_BUS_SESSION, &err);
+ bus = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
g_assert(bus != NULL);
g_assert(!dbus_error_is_set(&err));
dbus_connection_setup_with_g_main(bus, g_main_loop_get_context(main_loop));