]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Ignore unlink failures when dealing with the caching logic
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 10 Aug 2022 22:44:14 +0000 (23:44 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 10 Aug 2022 22:44:14 +0000 (23:44 +0100)
Issue: #4238

src/libserver/maps/map_helpers.c

index 456af4dc037d97b384bdfb41085525001b9aecdf..6381e6d511d5fc641b5549849dc7ad0ac531bca1 100644 (file)
@@ -1260,6 +1260,7 @@ rspamd_re_map_cache_cleanup_old (struct rspamd_regexp_map_helper *old_re_map)
 {
        gchar fp[PATH_MAX];
        struct rspamd_map *map;
+       gboolean ret = TRUE;
 
        map = old_re_map->map;
 
@@ -1276,7 +1277,7 @@ rspamd_re_map_cache_cleanup_old (struct rspamd_regexp_map_helper *old_re_map)
        if (unlink (fp) == -1) {
                msg_warn_map ("cannot unlink stale cache file for %s (%s): %s",
                                map->name, fp, strerror (errno));
-               return FALSE;
+               ret = FALSE;
        }
 
        GHashTable *valid_re_hashes;
@@ -1288,7 +1289,7 @@ rspamd_re_map_cache_cleanup_old (struct rspamd_regexp_map_helper *old_re_map)
                g_hash_table_remove (valid_re_hashes, fp);
        }
 
-       return TRUE;
+       return ret;
 }
 
 #endif