]> code.citadel.org Git - citadel.git/blobdiff - citadel/server/housekeeping.c
Additional memory allocated since startup: %d bytes message now identical to other...
[citadel.git] / citadel / server / housekeeping.c
index 55e7e77d68058f1b9b84fcb4a6d1a97ebbeadbfd..a5daff9f0ae221a0815eb2714e51e63000d40e5c 100644 (file)
@@ -71,7 +71,7 @@ void check_ref_counts(void) {
 void keep_an_eye_on_memory_usage(void) {
        static void *original_brk = NULL;
        if (!original_brk) original_brk = sbrk(0);      // Remember the original program break so we can test for leaks
-       syslog(LOG_DEBUG, "original_brk=%lx, current_brk=%lx, addl=%ld", (long)original_brk, (long)sbrk(0), (long)(sbrk(0)-original_brk));
+       syslog(LOG_DEBUG, "Additional memory allocated since startup: %d bytes", (sbrk(0)-original_brk));
 }
 
 
@@ -88,7 +88,7 @@ void do_housekeeping(void) {
        int do_perminute_housekeeping_now = 0;
        time_t now;
 
-       if (housekeeping_disabled) {
+       if ( (housekeeping_disabled) || (housekeeping_in_progress) ) {
                return;
        }
 
@@ -113,6 +113,10 @@ void do_housekeeping(void) {
                return;
        }
 
+       if (!do_housekeeping_now) {
+               return;
+       }
+
        // Ok, at this point we've made the decision to run the housekeeping
        // loop.  Everything below this point is real work.