aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorkremlin <ian@kremlin.cc>2014-05-28 09:45:02 +0800
committerkremlin <ian@kremlin.cc>2014-05-28 09:45:02 +0800
commitea207ed3d155cde4001063c981f7a263c47daf64 (patch)
tree620681056dfaee46812c5f534f7673735b272f7a /src/modules
parenta262d8ee186bd0b828ea201549aca5990b47efb7 (diff)
downloadsystembsd-ea207ed3d155cde4001063c981f7a263c47daf64.tar
systembsd-ea207ed3d155cde4001063c981f7a263c47daf64.tar.gz
systembsd-ea207ed3d155cde4001063c981f7a263c47daf64.tar.bz2
systembsd-ea207ed3d155cde4001063c981f7a263c47daf64.tar.lz
systembsd-ea207ed3d155cde4001063c981f7a263c47daf64.tar.xz
systembsd-ea207ed3d155cde4001063c981f7a263c47daf64.tar.zst
systembsd-ea207ed3d155cde4001063c981f7a263c47daf64.zip
begin hostnamed, clean up
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/hostnamed/hostnamed.c35
-rw-r--r--src/modules/hostnamed/tmp1
2 files changed, 34 insertions, 2 deletions
diff --git a/src/modules/hostnamed/hostnamed.c b/src/modules/hostnamed/hostnamed.c
index ee25324..f3632f6 100644
--- a/src/modules/hostnamed/hostnamed.c
+++ b/src/modules/hostnamed/hostnamed.c
@@ -1,2 +1,35 @@
-#include <glib-2.0/glib.h>
+/* #include <glib-2.0/glib.h> */
+#include <gio/gio.h>
+
+static void on_bus_acquired(GDBusConnection *conn, const gchar *name, gpointer user_data) {
+ g_print("got bus, name: %s\n", name);
+
+ /* g_print("at %p, data @ %p\n", (void*)conn, user_data); */
+}
+
+static void on_name_acquired(GDBusConnection *conn, const gchar *name, gpointer user_data) {
+ g_print("got name %s\n", name);
+
+ /* g_print("at %p, data @ %p\n", (void*)conn, user_data); */
+}
+
+static void on_name_lost(GDBusConnection *conn, const gchar *name, gpointer user_data) {
+ g_print("lost name %s\n", name);
+
+ /* g_print("at %p, data @ %p\n", (void*)conn, user_data); */
+}
+
+void hostnamed_init() {
+ guint bus_descriptor;
+ GError *err = NULL;
+
+ bus_descriptor = g_bus_own_name(G_BUS_TYPE_SYSTEM,
+ (gchar *)"org.freedesktop.hostname1",
+ G_BUS_NAME_OWNER_FLAGS_NONE,
+ on_bus_acquired,
+ on_name_acquired,
+ on_name_lost,
+ NULL,
+ NULL);
+}
diff --git a/src/modules/hostnamed/tmp b/src/modules/hostnamed/tmp
deleted file mode 100644
index c32d7ff..0000000
--- a/src/modules/hostnamed/tmp
+++ /dev/null
@@ -1 +0,0 @@
-TODO: delete me