chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: add tests for environment serialization
[elogind.git]
/
src
/
basic
/
hostname-util.c
diff --git
a/src/basic/hostname-util.c
b/src/basic/hostname-util.c
index a5cb62eb661e03eaf16682241f82d830ee952e46..63329d53b265f15644811616c8701aa66101341b 100644
(file)
--- a/
src/basic/hostname-util.c
+++ b/
src/basic/hostname-util.c
@@
-57,7
+57,11
@@
char* gethostname_malloc(void) {
assert_se(uname(&u) >= 0);
if (isempty(u.nodename) || streq(u.nodename, "(none)"))
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);
}
return strdup(u.nodename);
}
@@
-168,7
+172,6
@@
char* hostname_cleanup(char *s) {
*(d++) = *p;
dot = false;
}
*(d++) = *p;
dot = false;
}
-
}
if (dot && d > s)
}
if (dot && d > s)