System users (SYS_*) now have proper user numbers.
[citadel.git] / citadel / modules / checkpoint / serv_checkpoint.c
index 819f1989b7bc20822feadb8b6478837926c6cf92..a410bbcc2ccc779fcad2da0f0c7a417713bf6b59 100644 (file)
@@ -28,6 +28,8 @@
 #error Citadel requires Berkeley DB v4.1 or newer.  Please upgrade.
 #endif
 
+#include <libcitadel.h>
+
 #include "citadel.h"
 #include "server.h"
 #include "citserver.h"
@@ -35,6 +37,7 @@
 #include "msgbase.h"
 #include "sysdep_decls.h"
 #include "config.h"
+#include "threads.h"
 
 #include "ctdl_module.h"
  
@@ -46,12 +49,8 @@ void *checkpoint_thread(void *arg) {
 
        CtdlLogPrintf(CTDL_DEBUG, "checkpoint_thread() initializing\n");
 
-       memset(&checkpointCC, 0, sizeof(struct CitContext));
-       checkpointCC.internal_pgm = 1;
-       checkpointCC.cs_pid = 0;
-       pthread_setspecific(MyConKey, (void *)&checkpointCC );
-
-       cdb_allocate_tsd();
+       CtdlFillSystemContext(&checkpointCC, "checkpoint");
+       citthread_setspecific(MyConKey, (void *)&checkpointCC );
 
        while (!CtdlThreadCheckStop()) {
                cdb_checkpoint();