aboutsummaryrefslogtreecommitdiffstats
path: root/src/interfaces
diff options
context:
space:
mode:
authorkremlin <ian@kremlin.cc>2014-07-11 00:24:40 +0800
committerkremlin <ian@kremlin.cc>2014-07-11 00:24:40 +0800
commitd15318db3e7290d10cca372000cbdd0bdbc9fc6a (patch)
treebeb5f995d7f6253822b0c6d017fd4b2fef08d80d /src/interfaces
parent7f0a0212d65905aea6c875b6250e0a87dc9820d8 (diff)
downloadsystembsd-d15318db3e7290d10cca372000cbdd0bdbc9fc6a.tar
systembsd-d15318db3e7290d10cca372000cbdd0bdbc9fc6a.tar.gz
systembsd-d15318db3e7290d10cca372000cbdd0bdbc9fc6a.tar.bz2
systembsd-d15318db3e7290d10cca372000cbdd0bdbc9fc6a.tar.lz
systembsd-d15318db3e7290d10cca372000cbdd0bdbc9fc6a.tar.xz
systembsd-d15318db3e7290d10cca372000cbdd0bdbc9fc6a.tar.zst
systembsd-d15318db3e7290d10cca372000cbdd0bdbc9fc6a.zip
set hostnamed's 'hostname' property before export
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/hostnamed/hostnamed.c10
1 files changed, 9 insertions, 1 deletions
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 *