summaryrefslogtreecommitdiffstats
path: root/src/statfile.c
diff options
context:
space:
mode:
authorcebka@lenovo-laptop <cebka@lenovo-laptop>2010-02-27 18:59:05 +0300
committercebka@lenovo-laptop <cebka@lenovo-laptop>2010-02-27 18:59:05 +0300
commit730d2740eb77ff757cbeca6bc56151327cfa1ed0 (patch)
tree109cf0689e286360b78b071348b557e6eac2f8ff /src/statfile.c
parent246f7ec03f58e7efce2727c9196a4031d45ae5dd (diff)
downloadrspamd-730d2740eb77ff757cbeca6bc56151327cfa1ed0.tar.gz
rspamd-730d2740eb77ff757cbeca6bc56151327cfa1ed0.zip
* Fix cores in spf code (partially)
* Add support for spf 2.0 (Sender ID policy) * Add support of MAP_NOCORE to systems that supports it (FreeBSD for example)
Diffstat (limited to 'src/statfile.c')
-rw-r--r--src/statfile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/statfile.c b/src/statfile.c
index c3313e47a..1e47b3ec7 100644
--- a/src/statfile.c
+++ b/src/statfile.c
@@ -104,7 +104,11 @@ convert_statfile_10 (stat_file_t * file)
/* Unmap old memory and map new */
munmap (file->map, file->len);
file->len = file->len + sizeof (struct stat_file_header) - sizeof (struct stat_file_header_10);
+#ifdef HAVE_MMAP_NOCORE
+ if ((file->map = mmap (NULL, file->len, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_NOCORE, file->fd, 0)) == MAP_FAILED) {
+#else
if ((file->map = mmap (NULL, file->len, PROT_READ | PROT_WRITE, MAP_SHARED, file->fd, 0)) == MAP_FAILED) {
+#endif
msg_info ("cannot mmap file %s, error %d, %s", file->filename, errno, strerror (errno));
return FALSE;
}