]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Map absence is not an error
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 3 Jan 2018 20:37:03 +0000 (20:37 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 3 Jan 2018 20:37:03 +0000 (20:37 +0000)
src/libutil/map.c

index 6061aa927aab7dfa3d1e8f3ccc738b28950711cd..01bafc82c8b1b065d31b5cf0bc4520e637471b72 100644 (file)
@@ -841,9 +841,17 @@ read_map_file (struct rspamd_map *map, struct file_map_data *data,
 
        if (access (data->filename, R_OK) == -1) {
                /* File does not exist, skipping */
-               msg_err_map ("%s: map file is unavailable for reading",
-                               data->filename);
-               return TRUE;
+               if (errno != ENOENT) {
+                       msg_err_map ("%s: map file is unavailable for reading: %s",
+                                       data->filename, strerror (errno));
+
+                       return FALSE;
+               }
+               else {
+                       msg_info_map ("%s: map file is not found",
+                                       data->filename);
+                       return TRUE;
+               }
        }
 
        bytes = rspamd_file_xmap (data->filename, PROT_READ, &len, TRUE);