summaryrefslogtreecommitdiff
path: root/src/core/hostname-setup.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-02-17 13:51:27 +0100
committerGitHub <noreply@github.com>2017-02-17 13:51:27 +0100
commitea2aa0343f91f3cd2842129e94dbf05525732e7f (patch)
tree277f0db1b4c19bfdb8304d5f35b6168e0e8f4475 /src/core/hostname-setup.c
parentf73e6ee687213d8f78a93a9519901d0fe314c228 (diff)
parenta25b0dc82d10f8c53ac362f12f9a492062404b34 (diff)
Merge pull request #5366 from poettering/default-hostname-fix
fallback hostname fixes
Diffstat (limited to 'src/core/hostname-setup.c')
-rw-r--r--src/core/hostname-setup.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c
index 68be52856b..845e31e1c5 100644
--- a/src/core/hostname-setup.c
+++ b/src/core/hostname-setup.c
@@ -31,10 +31,10 @@
#include "util.h"
int hostname_setup(void) {
- int r;
_cleanup_free_ char *b = NULL;
- const char *hn;
bool enoent = false;
+ const char *hn;
+ int r;
r = read_hostname_config("/etc/hostname", &b);
if (r < 0) {
@@ -56,7 +56,7 @@ int hostname_setup(void) {
if (enoent)
log_info("No hostname configured.");
- hn = "localhost";
+ hn = FALLBACK_HOSTNAME;
}
r = sethostname_idempotent(hn);