diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-12-04 17:35:22 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-12-16 10:54:57 +0100 |
commit | 7d9ec609903a0d4ae121bb2cc39aa74773eee984 (patch) | |
tree | 9534436ddac0d2b45795a2256750327be7e1fe6b /src/hostname | |
parent | hostnamed: expose the fallback-hostname setting as a const dbus property (diff) | |
download | systemd-7d9ec609903a0d4ae121bb2cc39aa74773eee984.tar.xz systemd-7d9ec609903a0d4ae121bb2cc39aa74773eee984.zip |
hostnamed: fix return value
Diffstat (limited to 'src/hostname')
-rw-r--r-- | src/hostname/hostnamed.c | 6 |
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")); |