diff --git a/conf/conf.c b/conf/conf.c index c17358c1..c5ce6f5a 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -246,14 +246,6 @@ config_del_obstacle(struct config *c) static int global_commit(struct config *new, struct config *old) { - if (!new->hostname) - { - new->hostname = get_hostname(new->mem); - - if (!new->hostname) - log(L_WARN "Cannot determine hostname"); - } - if (!old) return 0; @@ -289,6 +281,14 @@ config_do_commit(struct config *c, int type) old_cftype = type; config = c; + if (!c->hostname) + { + c->hostname = get_hostname(c->mem); + + if (!c->hostname) + log(L_WARN "Cannot determine hostname"); + } + configuring = 1; if (old_config && !config->shutdown) log(L_INFO "Reconfiguring");