From: kremlin Date: Mon, 2 Jun 2014 21:47:44 +0000 (-0500) Subject: minor, reference issue X-Git-Tag: hostnamed-copyable~42 X-Git-Url: https://uglyman.kremlin.cc/gitweb/gitweb.cgi?a=commitdiff_plain;h=6de394d4129d558807da8d52bc736494ccfbb387;p=systembsd.git minor, reference issue --- diff --git a/src/interfaces/hostnamed/hostnamed.c b/src/interfaces/hostnamed/hostnamed.c index 3f461e9..114ad10 100644 --- a/src/interfaces/hostnamed/hostnamed.c +++ b/src/interfaces/hostnamed/hostnamed.c @@ -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; }