diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-06-05 16:39:59 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-06-05 16:39:59 +0400 |
commit | 3cd423a9d825d10c2e0390a2a35a5f99a1f74127 (patch) | |
tree | 692d75f333e2158b6427b2aa91be23702a49e5d3 /src/util.c | |
parent | 2be622266017d22e7f65d47bc4023d0135d3e29b (diff) | |
download | rspamd-3cd423a9d825d10c2e0390a2a35a5f99a1f74127.tar.gz rspamd-3cd423a9d825d10c2e0390a2a35a5f99a1f74127.zip |
* Do not use values from clock_gettime for getting current time
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c index 026cfbd23..cb2d948ec 100644 --- a/src/util.c +++ b/src/util.c @@ -936,22 +936,24 @@ parse_host_list (memory_pool_t *pool, GHashTable *tbl, const char *filename) } gboolean -maybe_parse_host_list (memory_pool_t *pool, GHashTable *tbl, const char *filename, time_t tv) +maybe_parse_host_list (memory_pool_t *pool, GHashTable *tbl, const char *filename) { struct list_file *lf; struct stat cur_st; + time_t cur_time = time (NULL); if (listfiles == NULL || (lf = g_hash_table_lookup (listfiles, filename)) == NULL) { /* Do not try to parse unknown files */ return FALSE; } - if (tv - lf->st.st_mtime > MON_TIMEOUT) { + if (cur_time - lf->st.st_mtime > MON_TIMEOUT) { /* Try to stat */ if (stat (lf->filename, &cur_st) != -1) { if (cur_st.st_mtime > lf->st.st_mtime) { g_hash_table_remove (listfiles, lf->filename); g_hash_table_remove_all (tbl); + msg_info ("maybe_parse_host_list: file %s was modified and rereaded", filename); return parse_host_list (pool, tbl, filename); } } |