diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-07-09 20:45:11 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-07-09 20:45:11 +0400 |
commit | 2234daebbb352b444b322d43cc6c1093f0ce949c (patch) | |
tree | 320131facabccd4f5aa3eddc465bc50a707b2b00 /src/statfile.c | |
parent | 19baadf6a0e6b2554de67b674a2c6f30efda13bb (diff) | |
download | rspamd-2234daebbb352b444b322d43cc6c1093f0ce949c.tar.gz rspamd-2234daebbb352b444b322d43cc6c1093f0ce949c.zip |
* Make autolearn working
Diffstat (limited to 'src/statfile.c')
-rw-r--r-- | src/statfile.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/statfile.c b/src/statfile.c index ac0c3bfaa..4a52008ed 100644 --- a/src/statfile.c +++ b/src/statfile.c @@ -129,9 +129,8 @@ statfile_pool_open (statfile_pool_t *pool, char *filename) struct stat st; stat_file_t *new_file; - if (statfile_pool_is_open (pool, filename) != NULL) { - msg_info ("statfile_pool_open: file %s is already opened", filename); - return NULL; + if ((new_file = statfile_pool_is_open (pool, filename)) != NULL) { + return new_file; } if (pool->opened >= STATFILES_MAX - 1) { @@ -400,9 +399,10 @@ statfile_pool_set_block (statfile_pool_t *pool, stat_file_t *file, uint32_t h1, stat_file_t * statfile_pool_is_open (statfile_pool_t *pool, char *filename) { - static stat_file_t f; + static stat_file_t f, *ret; f.filename = filename; - return bsearch (&f, pool->files, pool->opened, sizeof (stat_file_t), cmpstatfile); + ret = bsearch (&f, pool->files, pool->opened, sizeof (stat_file_t), cmpstatfile); + return ret; } uint32_t |