From: Nick Mathewson Date: Wed, 28 Jun 2006 08:54:32 +0000 (+0000) Subject: Actually enable mmap. That should improve matters. X-Git-Tag: tor-0.1.1.23~156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cd04abf1a21f5b15ad5a34c0ee50e3b9f93ba57;p=thirdparty%2Ftor.git Actually enable mmap. That should improve matters. svn:r6694 --- 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; }