commit 80bc6d9: [Minor] Ignore unlink failures when dealing with the caching logic

Vsevolod Stakhov vsevolod at rspamd.com
Wed Aug 10 22:49:04 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-08-10 23:44:14 +0100
URL: https://github.com/rspamd/rspamd/commit/80bc6d9d7588a2ec3d802e7b01a3b2b1d5d5dce9 (HEAD -> master)

[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


More information about the Commits mailing list