Browse Source

[Fix] Map absence is not an error

tags/1.7.0
Vsevolod Stakhov 6 years ago
parent
commit
a7dcf4ce8a
1 changed files with 11 additions and 3 deletions
  1. 11
    3
      src/libutil/map.c

+ 11
- 3
src/libutil/map.c View 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);

Loading…
Cancel
Save