diff options
author | kremlin <ian@kremlin.cc> | 2014-07-11 00:24:40 +0800 |
---|---|---|
committer | kremlin <ian@kremlin.cc> | 2014-07-11 00:24:40 +0800 |
commit | 043bd2ed1a6b27f4208c2484e54568ed74b23280 (patch) | |
tree | beb5f995d7f6253822b0c6d017fd4b2fef08d80d | |
parent | c09a09bfcbfbd12fb6b48e06f087429b1b6ac864 (diff) | |
download | systembsd-043bd2ed1a6b27f4208c2484e54568ed74b23280.tar systembsd-043bd2ed1a6b27f4208c2484e54568ed74b23280.tar.gz systembsd-043bd2ed1a6b27f4208c2484e54568ed74b23280.tar.bz2 systembsd-043bd2ed1a6b27f4208c2484e54568ed74b23280.tar.lz systembsd-043bd2ed1a6b27f4208c2484e54568ed74b23280.tar.xz systembsd-043bd2ed1a6b27f4208c2484e54568ed74b23280.tar.zst systembsd-043bd2ed1a6b27f4208c2484e54568ed74b23280.zip |
set hostnamed's 'hostname' property before export
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/interfaces/hostnamed/hostnamed.c | 10 |
2 files changed, 10 insertions, 2 deletions
@@ -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 <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 * |