From 80bc6d9d7588a2ec3d802e7b01a3b2b1d5d5dce9 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 10 Aug 2022 23:44:14 +0100 Subject: [PATCH] [Minor] Ignore unlink failures when dealing with the caching logic Issue: #4238 --- src/libserver/maps/map_helpers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libserver/maps/map_helpers.c b/src/libserver/maps/map_helpers.c index 456af4dc0..6381e6d51 100644 --- a/src/libserver/maps/map_helpers.c +++ b/src/libserver/maps/map_helpers.c @@ -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 -- 2.39.5