diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-02-16 12:02:17 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-02-17 10:19:26 +0100 |
commit | d91e8e1b696a58ec98099dbca517d748b382c3e9 (patch) | |
tree | a13056d7a75eb1721186bf3e467c99eea0bed085 /src | |
parent | f73e6ee687213d8f78a93a9519901d0fe314c228 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/hostname-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |