summaryrefslogtreecommitdiffstats
path: root/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'server.c')
-rw-r--r--server.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/server.c b/server.c
index dcd115f3..8cfc607c 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.45 2008-05-31 20:04:15 nicm Exp $ */
+/* $Id: server.c,v 1.46 2008-06-02 18:08:17 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -62,6 +62,7 @@ server_start(const char *path)
size_t size;
mode_t mask;
int n, fd, mode;
+ char *cause;
switch (fork()) {
case -1:
@@ -109,6 +110,13 @@ server_start(const char *path)
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
fatal("fcntl failed");
+ /* Load configuration. */
+ if (cfg_file != NULL && load_cfg(cfg_file, &cause) != 0) {
+ log_warnx("%s", cause);
+ xfree(cause);
+ exit(1);
+ }
+
if (daemon(1, 1) != 0)
fatal("daemon failed");
log_debug("server daemonised, pid now %ld", (long) getpid());
@@ -135,7 +143,7 @@ server_main(const char *srv_path, int srv_fd)
ARRAY_INIT(&sessions);
key_bindings_init();
-
+
pfds = NULL;
while (!sigterm) {
/* Initialise pollfd array. */