From d91e8e1b696a58ec98099dbca517d748b382c3e9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 16 Feb 2017 12:02:17 +0100 Subject: 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. --- src/basic/hostname-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/hostname-util.c b/src/basic/hostname-util.c index e44a357287..a94037b303 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); } -- cgit v1.2.3-54-g00ecf