server.c: Init the now timeval early.
authorAndre Noll <maan@systemlinux.org>
Sun, 11 Jan 2009 16:06:03 +0000 (17:06 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 11 Jan 2009 16:06:03 +0000 (17:06 +0100)
It is used at least in init_vss() which gets called before schedule().

server.c

index 96a40f3..287b628 100644 (file)
--- a/server.c
+++ b/server.c
@@ -64,6 +64,7 @@
 
 #include <signal.h>
 #include <dirent.h>
+#include <sys/time.h>
 
 #include "para.h"
 #include "error.h"
@@ -486,6 +487,8 @@ static void server_init(int argc, char **argv)
        parse_config(0);
        log_welcome("para_server", conf.loglevel_arg);
        shm_init(); /* init mmd struct */
+       /* make sure, the global now pointer is uptodate */
+       gettimeofday(now, NULL);
        server_uptime(UPTIME_SET); /* reset server uptime */
        init_user_list(user_list_file);
        /* become daemon */