set hostnamed's 'hostname' property before export
authorkremlin <ian@kremlin.cc>
Thu, 10 Jul 2014 16:24:40 +0000 (11:24 -0500)
committerkremlin <ian@kremlin.cc>
Thu, 10 Jul 2014 16:24:40 +0000 (11:24 -0500)
Makefile
src/interfaces/hostnamed/hostnamed.c

index 2d0ad82c27dce6a417e1c9991df222338c8ddfeb..084a948f9f8c64ed447b94d8cefd000526526684 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 .PHONY: all
 
 CFLAGS=-Wall -Wextra -Werror -std=c89 
-DEBUGF=-O0 -v -g
+DEBUGF=-O0 -g
 SRCDIR=src
 INTFDIR=$(SRCDIR)/interfaces
 SANITY=-Wno-unused-variable -Wno-unused-parameter # -Wno-comment
index f250aaab8b3c666b1776011e163151324325cd32..e1614978c1cb03309ac61ed3ffb49f1576282b3d 100644 (file)
@@ -17,6 +17,8 @@
 #include <unistd.h>
 #include <limits.h>
 
+#include <sys/param.h>
+
 #include <glib.h>
 #include <gio/gio.h>
 
@@ -79,7 +81,13 @@ on_handle_set_icon_name(hostnamedHostname1 *hn1_passed_interf,
 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 *