hostnamed: fix return value
This commit is contained in:
parent
ce6b138c75
commit
7d9ec60990
|
@ -323,6 +323,7 @@ static int context_update_kernel_hostname(
|
||||||
|
|
||||||
const char *static_hn, *hn;
|
const char *static_hn, *hn;
|
||||||
struct utsname u;
|
struct utsname u;
|
||||||
|
int r;
|
||||||
|
|
||||||
assert(c);
|
assert(c);
|
||||||
|
|
||||||
|
@ -352,8 +353,9 @@ static int context_update_kernel_hostname(
|
||||||
else
|
else
|
||||||
hn = FALLBACK_HOSTNAME;
|
hn = FALLBACK_HOSTNAME;
|
||||||
|
|
||||||
if (sethostname_idempotent(hn) < 0)
|
r = sethostname_idempotent(hn);
|
||||||
return -errno;
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
(void) nscd_flush_cache(STRV_MAKE("hosts"));
|
(void) nscd_flush_cache(STRV_MAKE("hosts"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue