X-Git-Url: https://uglyman.kremlin.cc/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2Finterfaces%2Fhostnamed%2Fhostnamed.c;h=42137cde94e27b8418da12ab4fa3bfb85343c648;hb=fc22d298fef215ccb3c156c30f05e080861c281b;hp=1ce443e64c8cffbf24b5bfa49197d498f92975c1;hpb=15c779beb04802541e6b3ab0475243ca87674b75;p=systembsd.git diff --git a/src/interfaces/hostnamed/hostnamed.c b/src/interfaces/hostnamed/hostnamed.c index 1ce443e..42137cd 100644 --- a/src/interfaces/hostnamed/hostnamed.c +++ b/src/interfaces/hostnamed/hostnamed.c @@ -1,6 +1,5 @@ #include -GMainLoop *loop; GDBusNodeInfo *spect_data; static void handle_method_call(GDBusConnection *conn, @@ -12,9 +11,7 @@ static void handle_method_call(GDBusConnection *conn, GDBusMethodInvocation *invc, gpointer usrdat) { - //g_printf("%s wants to call %s, at %s with interface %s\n", sender, method_name, obj_path, interf_name); - - if(g_strcmp0(method_name, "Introspect" + //if(g_strcmp0(method_name, "Introspect" GVariant *xml_ret_gvar; GString *xml_ret; @@ -98,9 +95,9 @@ static void on_name_lost(GDBusConnection *conn, const gchar *name, gpointer user_data) { - g_print("lost name %s, exiting...\n", name); - //g_print("you might need to run hacks/punch_config.sh\n"); - g_main_loop_quit(loop); + g_print("lost name %s, exiting...", name); + //TODO exit through g_main_loop properly... + exit(0); } /* safe call to try and start hostnamed */ @@ -108,9 +105,7 @@ 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_SYSTEM, (gchar *)"org.freedesktop.hostname1", G_BUS_NAME_OWNER_FLAGS_NONE, @@ -120,9 +115,6 @@ GError * hostnamed_init() { NULL, NULL); - loop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(loop); - //TODO: malloc and return reference as if a main() closed return err; }