summaryrefslogtreecommitdiff
path: root/legacy-app-handler/main.c
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2012-07-06 13:51:03 +0100
committerJonathan Maw <jonathan.maw@codethink.co.uk>2012-07-10 12:14:31 +0100
commitbeac0e70767b2e4945a239bbac2cb3bcbea46faf (patch)
tree5ca4311b7b38ae9af6f07ad30904a9aca24fce4a /legacy-app-handler/main.c
parentb037ff91e2d985674e6ef6f0b78deef8c6f8d91b (diff)
downloadnode-startup-controller-beac0e70767b2e4945a239bbac2cb3bcbea46faf.tar.gz
Change legacy app handler to register on the system bus
Makes the legacy app handler connect to the system bus instead of the session bus. This commit also changes bus names to consistently use LegacyAppHandler1 instead of LAHandler1. This commit does not allow communication with the legacy app handler by command-line. The following commit will provide this. This commit does not provide a way to start the legacy app handler through systemd. The following commit also provides this.
Diffstat (limited to 'legacy-app-handler/main.c')
-rw-r--r--legacy-app-handler/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/legacy-app-handler/main.c b/legacy-app-handler/main.c
index 8ac39fc..a7a9d93 100644
--- a/legacy-app-handler/main.c
+++ b/legacy-app-handler/main.c
@@ -69,8 +69,8 @@ main (int argc,
g_type_init ();
/* attempt to connect to D-Bus */
- connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
- if (connection == NULL)
+ connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
+ if (connection == NULL || error != NULL || !G_IS_DBUS_CONNECTION (connection))
{
log_text = g_strdup_printf ("Failed to connect to D-Bus: %s", error->message);
DLT_LOG (la_handler_context, DLT_LOG_ERROR, DLT_STRING (log_text));
@@ -117,6 +117,8 @@ main (int argc,
application =
la_handler_application_new (service, G_APPLICATION_IS_SERVICE);
}
+
+ /* run the application */
exit_status = g_application_run (G_APPLICATION (application), argc, argv);
g_object_unref (application);