]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_expire.c
- declare *printf format specifiers if gcc detected
[citadel.git] / citadel / serv_expire.c
index 127b05ccd889af0b65809e7074e6308ae007a0fe..cffe99032193b2faf25ee7ab15588079f318549b 100644 (file)
 #include <pwd.h>
 #include <errno.h>
 #include <sys/types.h>
-#include <sys/time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
 #include "citadel.h"
 #include "server.h"
 #include <syslog.h>
-#include <time.h>
 #include "sysdep_decls.h"
 #include "citserver.h"
 #include "support.h"
 #include "tools.h"
 
 
-struct oldvisit {
-       char v_roomname[ROOMNAMELEN];
-       long v_generation;
-       long v_lastseen;
-       unsigned int v_flags;
-};
-
 struct PurgeList {
        struct PurgeList *next;
        char name[ROOMNAMELEN]; /* use the larger of username or roomname */
@@ -280,7 +283,7 @@ void DoPurgeRooms(struct quickroom *qrbuf, void *data) {
                age = time(NULL) - (qrbuf->QRmtime);
                purge_secs = (time_t)config.c_roompurge * (time_t)86400;
                if (purge_secs <= (time_t)0) return;
-               lprintf(9, "<%s> is <%ld> seconds old\n", qrbuf->QRname, age);
+               lprintf(9, "<%s> is <%ld> seconds old\n", qrbuf->QRname, (long)age);
                if (age > purge_secs) do_purge = 1;
        } /* !QR_MAILBOX */
 
@@ -472,7 +475,6 @@ int PurgeVisits(void) {
        ForEachUser(AddValidUser, NULL);
 
        /* Now traverse through the visits, purging irrelevant records... */
-       cdb_begin_transaction();
        cdb_rewind(CDB_VISIT);
        while(cdbvisit = cdb_next_item(CDB_VISIT), cdbvisit != NULL) {
                memset(&vbuf, 0, sizeof(struct visit));
@@ -510,8 +512,6 @@ int PurgeVisits(void) {
 
        }
 
-       cdb_end_transaction();
-
        /* Free the valid room/gen combination list */
        while (ValidRoomList != NULL) {
                vrptr = ValidRoomList->next;