X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fbasic%2Fhostname-util.c;h=63329d53b265f15644811616c8701aa66101341b;hb=9b00a533195b7fec54a791ca02090e0799214770;hp=a5cb62eb661e03eaf16682241f82d830ee952e46;hpb=35eec258c4523c92fe985d764198b266ebc3881a;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)