Add a login-on-connect module using XQUERY/XRESPONSE.
[srvx.git] / src / main-common.c
index 248d610f9abdfdbf79481661909a5e1af51994f2..229088b7b3155add24428b768b37ac59295f14df 100644 (file)
@@ -1,6 +1,8 @@
 extern FILE *replay_file;
 
-time_t boot_time, burst_begin, now;
+unsigned long boot_time;
+unsigned long burst_begin;
+unsigned long now;
 unsigned long burst_length;
 struct log_type *MAIN_LOG;
 
@@ -59,8 +61,8 @@ static const struct message_entry msgtab[] = {
     { "MSG_DB_UNKNOWN", "I do not know of a database named %s." },
     { "MSG_DB_IS_MONDO", "Database %s is in the \"mondo\" database and cannot be written separately." },
     { "MSG_DB_WRITE_ERROR", "Error while writing database %s." },
-    { "MSG_DB_WROTE_DB", "Wrote database %s (in "FMT_TIME_T".%06lu seconds)." },
-    { "MSG_DB_WROTE_ALL", "Wrote all databases (in "FMT_TIME_T".%06lu seconds)." },
+    { "MSG_DB_WROTE_DB", "Wrote database %s (in %lu.%06lu seconds)." },
+    { "MSG_DB_WROTE_ALL", "Wrote all databases (in %lu.%06lu seconds)." },
     { "MSG_AND", "and" },
     { "MSG_0_SECONDS", "0 seconds" },
     { "MSG_YEAR", "year" },
@@ -275,7 +277,7 @@ uplink_select(char *name)
 
             if(max_cycles && (cManager.cycles >= max_cycles))
             {
-                log_module(MAIN_LOG, LOG_FATAL, "Maximum uplink list cycles exceeded; giving up.");
+                log_module(MAIN_LOG, LOG_ERROR, "Maximum uplink list cycles exceeded; giving up.");
                 exit(1);
             }
 
@@ -312,7 +314,7 @@ uplink_select(char *name)
            over. Use the current uplink if possible. */
         if(!cManager.uplink || cManager.uplink->flags & UPLINK_UNAVAILABLE)
         {
-            log_module(MAIN_LOG, LOG_FATAL, "All available uplinks exhausted; giving up.");
+            log_module(MAIN_LOG, LOG_ERROR, "All available uplinks exhausted; giving up.");
             exit(1);
         }
 
@@ -530,7 +532,7 @@ conf_rlimits(void)
 #endif
 
 static void
-usage(char *self)
+usage(char *exe_name)
 {
     /* We can assume we have getopt_long(). */
     printf("Usage: %s [-c config] [-r log] [-d] [-f] [-v|-h]\n"
@@ -541,7 +543,7 @@ usage(char *self)
            " -k, --check          checks the configuration file's syntax.\n"
            " -r, --replay         replay a log file (for debugging).\n"
            " -v, --version        prints this program's version.\n"
-           , self);
+           , exe_name);
 }
 
 static void
@@ -549,8 +551,10 @@ version()
 {
     printf("    --------------------------------------------------\n"
            "    - "PACKAGE_STRING" ("CODENAME"), Built: " __DATE__ ", " __TIME__".\n"
-           "    - Copyright (C) 2000 - 2005, srvx Development Team\n"
-           "    --------------------------------------------------\n");
+           "    - Copyright (C) 2000 - 2007, srvx Development Team\n"
+           "    - Version tag %s\n"
+           "    --------------------------------------------------\n",
+           git_version);
 }
 
 static void