diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-06-28 08:54:32 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-06-28 08:54:32 +0000 |
commit | 1cd04abf1a21f5b15ad5a34c0ee50e3b9f93ba57 (patch) | |
tree | 65088b9ef9dfc103f501bf7a52a8eaef8d8f74e2 /src/common | |
parent | d3784ff1df5f18db00db1d9e2e7d27f8b756507a (diff) | |
download | tor-1cd04abf1a21f5b15ad5a34c0ee50e3b9f93ba57.tar.gz tor-1cd04abf1a21f5b15ad5a34c0ee50e3b9f93ba57.zip |
Actually enable mmap. That should improve matters.
svn:r6694
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/compat.c | 5 |
1 files 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; } |