chiark / gitweb /
tests: add tests for environment serialization
[elogind.git] / src / basic / hostname-util.c
index d8d05df3cbdd00819157da95c41e5af9cfd4c91c..63329d53b265f15644811616c8701aa66101341b 100644 (file)
@@ -45,6 +45,7 @@ bool hostname_is_set(void) {
 
         return true;
 }
+#endif // 0
 
 char* gethostname_malloc(void) {
         struct utsname u;
@@ -56,11 +57,16 @@ char* gethostname_malloc(void) {
         assert_se(uname(&u) >= 0);
 
         if (isempty(u.nodename) || streq(u.nodename, "(none)"))
-                return strdup(u.sysname);
+#if 0 /// elogind has no hostnamed and such nonsense
+                return strdup(FALLBACK_HOSTNAME);
+#else
+                return strdup("localhost");
+#endif // 0
 
         return strdup(u.nodename);
 }
 
+#if 0 /// UNNEEDED by elogind
 int gethostname_strict(char **ret) {
         struct utsname u;
         char *k;
@@ -166,7 +172,6 @@ char* hostname_cleanup(char *s) {
                         *(d++) = *p;
                         dot = false;
                 }
-
         }
 
         if (dot && d > s)