minor, reference issue
authorkremlin <ian@kremlin.cc>
Mon, 2 Jun 2014 21:47:44 +0000 (16:47 -0500)
committerkremlin <ian@kremlin.cc>
Mon, 2 Jun 2014 21:47:44 +0000 (16:47 -0500)
src/interfaces/hostnamed/hostnamed.c

index 3f461e9e4f3a05ccadfafa72e708be27d57fa034..114ad10043d138b85cf143b7ad39a86976b9342f 100644 (file)
@@ -103,14 +103,14 @@ static void on_name_lost(GDBusConnection *conn,
 }
 
 /* safe call to try and start hostnamed */
-GError hostnamed_init() {
+GError hostnamed_init() {
 
        guint bus_descriptor;
        GError *err = NULL;     
 
        spect_data = g_dbus_node_info_new_for_xml(SYSTEMD_HOSTNAMED_XML, &err);
 
-       bus_descriptor = g_bus_own_name(G_BUS_TYPE_SESSION,
+       bus_descriptor = g_bus_own_name(G_BUS_TYPE_SYSTEM,
                                        (gchar *)"org.freedesktop.hostname1",
                                                    G_BUS_NAME_OWNER_FLAGS_NONE,
                                                    on_bus_acquired,
@@ -121,4 +121,7 @@ GError hostnamed_init() {
 
        loop = g_main_loop_new(NULL, FALSE);
        g_main_loop_run(loop);
+
+       //TODO: malloc and return reference as if a main() closed
+       return err;
 }