]> code.citadel.org Git - citadel.git/blobdiff - citadel/citserver.c
* added server command line option "-f" to defrag databases on startup
[citadel.git] / citadel / citserver.c
index 44a98d021bbf27470c04e1e362a7e5a8ecb3d733..e79fc29dbfae7b8de124e2b0815a921071076903 100644 (file)
@@ -40,6 +40,7 @@
 
 struct CitContext *ContextList = NULL;
 int ScheduledShutdown = 0;
+int do_defrag = 0;
 
 /*
  * Various things that need to be initialized at startup
@@ -48,6 +49,9 @@ void master_startup(void) {
        lprintf(7, "Opening databases\n");
        open_databases();
 
+       if (do_defrag)
+               defrag_databases();
+
        lprintf(7, "Checking floor reference counts\n");
        check_ref_counts();
 
@@ -824,7 +828,7 @@ void *context_loop(struct CitContext *con)
        strcpy(CC->cs_clientname, "(unknown)");
        strcpy(CC->curr_user,"(not logged in)");
        strcpy(CC->net_node,"");
-       snprintf(CC->temp, sizeof CC->temp, "/tmp/CitServer.%d.%d", getpid(), CC->cs_pid);
+       snprintf(CC->temp, sizeof CC->temp, tmpnam(NULL));
        strcpy(CC->cs_room, "(no room)");
        strncpy(CC->cs_host, config.c_fqdn, sizeof CC->cs_host);
        CC->cs_host[sizeof CC->cs_host - 1] = 0;