From 1cd04abf1a21f5b15ad5a34c0ee50e3b9f93ba57 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 28 Jun 2006 08:54:32 +0000 Subject: [PATCH] Actually enable mmap. That should improve matters. svn:r6694 --- src/common/compat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/compat.c b/src/common/compat.c index 4a95a1ac12..a376285a6d 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -107,7 +107,7 @@ const char compat_c_id[] = #define INADDR_NONE ((unsigned long) -1) #endif -#ifdef HAVE_SYS_MMAP +#ifdef HAVE_SYS_MMAN const char * tor_mmap_file(const char *filename, size_t *size) { @@ -152,7 +152,8 @@ const char * tor_mmap_file(const char *filename, size_t *size) { char *res = read_file_to_str(filename, 1); - *size = strlen(res) + 1; + if (res) + *size = strlen(res) + 1; return res; }