From: Vsevolod Stakhov Date: Thu, 5 Dec 2013 00:11:40 +0000 (+0000) Subject: Do not resize statfile if old_size == new_size. X-Git-Tag: 0.6.2~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=67e996596247fc44b686599d46b8555420c180eb;p=rspamd.git Do not resize statfile if old_size == new_size. --- diff --git a/src/statfile.c b/src/statfile.c index b5d467426..9cc2d58f3 100644 --- a/src/statfile.c +++ b/src/statfile.c @@ -307,7 +307,7 @@ statfile_pool_open (statfile_pool_t * pool, gchar *filename, size_t size, gboole } memory_pool_lock_mutex (pool->lock); - if (!forced && size > sizeof (struct stat_file)) { + if (!forced && size != (size_t)st.st_size && size > sizeof (struct stat_file)) { memory_pool_unlock_mutex (pool->lock); msg_warn ("need to reindex statfile old size: %Hz, new size: %Hz", st.st_size, size); return statfile_pool_reindex (pool, filename, st.st_size, size);