more work on managing four interfaces as separate PIDs, new makefile rules for buildi...
[systembsd.git] / src / interfaces / hostnamed / hostnamed.c
index 6d06a34a1a57b48c007b0377dd36d84038aca9f3..f250aaab8b3c666b1776011e163151324325cd32 100644 (file)
@@ -138,7 +138,7 @@ our_get_os_pretty_name() {
 
 /* end method/property/signal code, begin bus/name handlers */
 
-static void on_bus_acquired(GDBusConnection *conn,
+static void hostnamed_on_bus_acquired(GDBusConnection *conn,
                             const gchar *name,
                             gpointer user_data) {
 
@@ -146,7 +146,7 @@ static void on_bus_acquired(GDBusConnection *conn,
 
 }
 
-static void on_name_acquired(GDBusConnection *conn,
+static void hostnamed_on_name_acquired(GDBusConnection *conn,
                              const gchar *name,
                              gpointer user_data) {
 
@@ -183,7 +183,7 @@ static void on_name_acquired(GDBusConnection *conn,
 
 }
 
-static void on_name_lost(GDBusConnection *conn,
+static void hostnamed_on_name_lost(GDBusConnection *conn,
                          const gchar *name,
                          gpointer user_data) {
 
@@ -196,34 +196,20 @@ static void on_name_lost(GDBusConnection *conn,
 }
 
 /* safe call to try and start hostnamed */
-GError *hostnamed_init() {
+void hostnamed_init() {
 
     guint bus_descriptor;
-    GError *err = NULL;
-    gchar **hostnamed_ispect_xml;
-    gchar  *hostnamed_joined_xml;
-
-    hostnamed_freeable = g_ptr_array_new();
-    hostnamed_ispect_xml = g_malloc(3000);
-
-    g_file_get_contents("conf/hostnamed-ispect.xml", hostnamed_ispect_xml, NULL, NULL);
-    hostnamed_joined_xml = g_strjoinv("\n", hostnamed_ispect_xml);
-    spect_data = g_dbus_node_info_new_for_xml(hostnamed_joined_xml, NULL);
-
-    g_free(hostnamed_ispect_xml);
-    g_ptr_array_add(hostnamed_freeable, hostnamed_joined_xml);
 
     bus_descriptor = g_bus_own_name(G_BUS_TYPE_SYSTEM,
                                     "org.freedesktop.hostname1",
                                     G_BUS_NAME_OWNER_FLAGS_NONE,
-                                    on_bus_acquired,
-                                    on_name_acquired,
-                                    on_name_lost,
+                                    hostnamed_on_bus_acquired,
+                                    hostnamed_on_name_acquired,
+                                    hostnamed_on_name_lost,
                                     NULL,
                                     NULL);
 
     /* TODO: malloc and return reference as if a main() closed */
-    return err;
 }
 
 /* free()'s */