summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-12-04 17:35:22 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-12-16 10:54:57 +0100
commit7d9ec609903a0d4ae121bb2cc39aa74773eee984 (patch)
tree9534436ddac0d2b45795a2256750327be7e1fe6b
parentce6b138c7576df55ede15f5d8b02a1766449bd1f (diff)
downloadsystemd-7d9ec609903a0d4ae121bb2cc39aa74773eee984.tar.gz
hostnamed: fix return value
-rw-r--r--src/hostname/hostnamed.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
index bec1fde5a5..e624ace754 100644
--- a/src/hostname/hostnamed.c
+++ b/src/hostname/hostnamed.c
@@ -323,6 +323,7 @@ static int context_update_kernel_hostname(
const char *static_hn, *hn;
struct utsname u;
+ int r;
assert(c);
@@ -352,8 +353,9 @@ static int context_update_kernel_hostname(
else
hn = FALLBACK_HOSTNAME;
- if (sethostname_idempotent(hn) < 0)
- return -errno;
+ r = sethostname_idempotent(hn);
+ if (r < 0)
+ return r;
(void) nscd_flush_cache(STRV_MAKE("hosts"));