Merge branch 't/unix_path_max_fix'
[paraslash.git] / server.c
index 9f237ad7f3d7e10dee527dce33f4b1ac0da30410..15ae5c9a296be654471fd1f95aa9395629fae097 100644 (file)
--- a/server.c
+++ b/server.c
  *     - Blob tables: \ref blob.c,
  *     - The error subssystem: \ref error.h.
  *     - Access control for paraslash senders: \ref acl.c, \ref acl.h.
+ *     - Internal crypto API: \ref crypt.h.
  *
  * Low-level data structures:
  *
  *     - Doubly linked lists: \ref list.h,
  *     - Ring buffer: \ref ringbuffer.c, \ref ringbuffer.h,
- *     - Crypto: \ref crypt.c, \ref crypt.h.
+ *     - openssl: \ref crypt.c
+ *     - libgcrypt: \ref gcrypt.c
  *     - Forward error correction: \ref fec.c.
  */
 
 #include <signal.h>
-#include <dirent.h>
 #include <sys/time.h>
 #include <regex.h>
 #include <osl.h>
@@ -89,6 +90,7 @@
 #include "signal.h"
 #include "user_list.h"
 #include "color.h"
+#include "version.h"
 
 /** Define the array of error lists needed by para_server. */
 INIT_SERVER_ERRLISTS;
@@ -489,7 +491,7 @@ static void server_init(int argc, char **argv)
        init_ipc_or_die(); /* init mmd struct and mmd->lock */
        /* make sure, the global now pointer is uptodate */
        gettimeofday(now, NULL);
-       server_uptime(UPTIME_SET); /* reset server uptime */
+       set_server_start_time(now);
        init_user_list(user_list_file);
        /* become daemon */
        if (conf.daemon_given)
@@ -523,7 +525,7 @@ static void server_init(int argc, char **argv)
 static void status_refresh(void)
 {
        static int prev_uptime = -1, prev_events = -1;
-       int uptime = server_uptime(UPTIME_GET), ret = 1;
+       int uptime = get_server_uptime(now);
 
        if (prev_events != mmd->events)
                goto out;
@@ -538,11 +540,8 @@ out:
        prev_uptime = uptime;
        prev_events = mmd->events;
        mmd->vss_status_flags = mmd->new_vss_status_flags;
-       if (ret) {
-               PARA_DEBUG_LOG("%d events, forcing status update\n",
-                       mmd->events);
-               killpg(0, SIGUSR1);
-       }
+       PARA_DEBUG_LOG("%d events, forcing status update\n", mmd->events);
+       killpg(0, SIGUSR1);
 }
 
 static int server_select(int max_fileno, fd_set *readfds, fd_set *writefds,