diff options
author | Michal Sekletar <msekleta@redhat.com> | 2014-10-21 18:17:54 +0200 |
---|---|---|
committer | Michal Sekletar <msekleta@redhat.com> | 2014-10-27 10:37:46 +0100 |
commit | 605f81a8968b2df8a28cca2cf11db99ab948a2af (patch) | |
tree | 5f7bc76ca61e8165860510ee181c57ecbfdd3055 /src/nspawn | |
parent | caa2f4c0c9613b2e02aafa308c8fb092576014a9 (diff) |
util: introduce sethostname_idempotent
Function queries system hostname and applies changes only when necessary. Also,
migrate all client of sethostname to sethostname_idempotent while at it.
Diffstat (limited to 'src/nspawn')
-rw-r--r-- | src/nspawn/nspawn.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index c567c8d272..b6d9bc631c 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -1289,7 +1289,7 @@ static int setup_hostname(void) { if (arg_share_system) return 0; - if (sethostname(arg_machine, strlen(arg_machine)) < 0) + if (sethostname_idempotent(arg_machine) < 0) return -errno; return 0; |