]> source.dussan.org Git - rspamd.git/commitdiff
Preserve statfiles versions on resize.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Sep 2013 13:51:15 +0000 (14:51 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Sep 2013 13:51:15 +0000 (14:51 +0100)
src/statfile.c

index e5672f8fadf2fcab63a5b70a65435ece256c8a61..ce7c474cce65dbbf8f111aa89ebc9296f81f5979 100644 (file)
@@ -227,6 +227,7 @@ statfile_pool_reindex (statfile_pool_t * pool, gchar *filename, size_t old_size,
        stat_file_t                    *new;
        u_char                         *map, *pos;
        struct stat_file_block         *block;
+       struct stat_file_header        *header;
 
        /* First of all rename old file */
        memory_pool_lock_mutex (pool->lock);
@@ -273,6 +274,9 @@ statfile_pool_reindex (statfile_pool_t * pool, gchar *filename, size_t old_size,
                }
                pos += sizeof (block);
        }
+
+       header = (struct stat_file_header *)map;
+       statfile_set_revision (new, header->revision, header->rev_time);
        
        munmap (map, old_size);
        close (fd);