hostnamed: fix return value

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-12-04 17:35:22 +01:00
parent ce6b138c75
commit 7d9ec60990
1 changed files with 4 additions and 2 deletions

View File

@ -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"));