From: Zbigniew Jędrzejewski-Szmek Date: Fri, 4 Dec 2020 16:35:22 +0000 (+0100) Subject: hostnamed: fix return value X-Git-Tag: v248-rc1~491^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d9ec609903a0d4ae121bb2cc39aa74773eee984;p=thirdparty%2Fsystemd.git hostnamed: fix return value --- diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index bec1fde5a55..e624ace7545 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"));