From: kremlin Date: Thu, 10 Jul 2014 16:24:40 +0000 (-0500) Subject: set hostnamed's 'hostname' property before export X-Git-Tag: gsoc-final~98 X-Git-Url: https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systembsd.git;a=commitdiff_plain;h=d15318db3e7290d10cca372000cbdd0bdbc9fc6a set hostnamed's 'hostname' property before export --- diff --git a/Makefile b/Makefile index 2d0ad82..084a948 100644 --- 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 diff --git a/src/interfaces/hostnamed/hostnamed.c b/src/interfaces/hostnamed/hostnamed.c index f250aaa..e161497 100644 --- a/src/interfaces/hostnamed/hostnamed.c +++ b/src/interfaces/hostnamed/hostnamed.c @@ -17,6 +17,8 @@ #include #include +#include + #include #include @@ -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 *