From: Lennart Poettering Date: Thu, 16 Feb 2017 11:02:17 +0000 (+0100) Subject: hostname-util: default to the compile time default hostname in gethostname_malloc() X-Git-Tag: v233~81^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d91e8e1b696a58ec98099dbca517d748b382c3e9;p=thirdparty%2Fsystemd.git hostname-util: default to the compile time default hostname in gethostname_malloc() Currently, if the hostname is not set gethostname_malloc() defaults to the "sysname", which is "linux" on Linux. Let's change that to also honour the compile-time fallback hostname as specified on the configure command line. --- diff --git a/src/basic/hostname-util.c b/src/basic/hostname-util.c index e44a357287c..a94037b3035 100644 --- a/src/basic/hostname-util.c +++ b/src/basic/hostname-util.c @@ -55,7 +55,7 @@ char* gethostname_malloc(void) { assert_se(uname(&u) >= 0); if (isempty(u.nodename) || streq(u.nodename, "(none)")) - return strdup(u.sysname); + return strdup(FALLBACK_HOSTNAME); return strdup(u.nodename); }