X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fbasic%2Fhostname-util.c;h=63329d53b265f15644811616c8701aa66101341b;hb=c0e8baacdbcf4cee407eb0c50c6fbb7e4e089158;hp=a5cb62eb661e03eaf16682241f82d830ee952e46;hpb=b4f4684f3a95c915491cd7845911ecdf2622b2c2;p=elogind.git diff --git a/src/basic/hostname-util.c b/src/basic/hostname-util.c index a5cb62eb6..63329d53b 100644 --- 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)")) - 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); } @@ -168,7 +172,6 @@ char* hostname_cleanup(char *s) { *(d++) = *p; dot = false; } - } if (dot && d > s)