projects
/
systembsd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor, update binaries
[systembsd.git]
/
src
/
interfaces
/
hostnamed
/
hostnamed.c
diff --git
a/src/interfaces/hostnamed/hostnamed.c
b/src/interfaces/hostnamed/hostnamed.c
index f250aaab8b3c666b1776011e163151324325cd32..3d1b3d2305d98d553ca9bae1811b5b136fcbb24f 100644
(file)
--- a/
src/interfaces/hostnamed/hostnamed.c
+++ b/
src/interfaces/hostnamed/hostnamed.c
@@
-17,11
+17,11
@@
#include <unistd.h>
#include <limits.h>
#include <unistd.h>
#include <limits.h>
-#include <glib.h>
-#include <gio/gio.h>
+#include <sys/param.h>
-#include "hostnamed.h"
-#include "hostnamed-gen.c"
+#include <glib/gprintf.h>
+
+#include "hostnamed-gen.h"
GPtrArray *hostnamed_freeable;
GDBusNodeInfo *spect_data;
GPtrArray *hostnamed_freeable;
GDBusNodeInfo *spect_data;
@@
-79,7
+79,13
@@
on_handle_set_icon_name(hostnamedHostname1 *hn1_passed_interf,
const gchar *
our_get_hostname() {
const gchar *
our_get_hostname() {
- return "TODO";
+ int hostname_try;
+ gchar *hostname_buf;
+
+ hostname_buf = (gchar*) g_malloc0(MAXHOSTNAMELEN);
+ hostname_try = gethostname(hostname_buf, MAXHOSTNAMELEN);
+
+ return hostname_buf;
}
const gchar *
}
const gchar *
@@
-183,6
+189,12
@@
static void hostnamed_on_name_acquired(GDBusConnection *conn,
}
}
+/* free()'s */
+void hostnamed_mem_clean() {
+
+ g_ptr_array_foreach(hostnamed_freeable, (GFunc) g_free, NULL);
+}
+
static void hostnamed_on_name_lost(GDBusConnection *conn,
const gchar *name,
gpointer user_data) {
static void hostnamed_on_name_lost(GDBusConnection *conn,
const gchar *name,
gpointer user_data) {
@@
-212,10
+224,19
@@
void hostnamed_init() {
/* TODO: malloc and return reference as if a main() closed */
}
/* TODO: malloc and return reference as if a main() closed */
}
-/* free()'s */
-void hostnamed_mem_clean() {
+int main() {
- g_ptr_array_foreach(hostnamed_freeable, (GFunc) g_free, NULL);
+ GMainLoop *hostnamed_loop;
+ hostnamed_loop = g_main_loop_new(NULL, TRUE);
+
+ /* config stuff here */
+
+
+ hostnamed_init();
+ g_main_loop_run(hostnamed_loop);
+ g_main_loop_unref(hostnamed_loop);
+
+ return 0;
}
/* TODO figure out DMI variables on obsd */
}
/* TODO figure out DMI variables on obsd */
@@
-263,3
+284,4
@@
void hostnamed_mem_clean() {
g_free (filebuf);
return ret;
}*/
g_free (filebuf);
return ret;
}*/
+