summaryrefslogtreecommitdiff
path: root/conf/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'conf/conf.c')
-rw-r--r--conf/conf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/conf/conf.c b/conf/conf.c
index 6f64b541..58abcde1 100644
--- a/conf/conf.c
+++ b/conf/conf.c
@@ -55,6 +55,7 @@
#include "lib/timer.h"
#include "conf/conf.h"
#include "filter/filter.h"
+#include "sysdep/unix/unix.h"
static jmp_buf conf_jmpbuf;
@@ -217,6 +218,14 @@ 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;