]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Actually enable mmap. That should improve matters.
authorNick Mathewson <nickm@torproject.org>
Wed, 28 Jun 2006 08:54:32 +0000 (08:54 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 28 Jun 2006 08:54:32 +0000 (08:54 +0000)
svn:r6694

src/common/compat.c

index 4a95a1ac1239ac2fc93f7c757a2eec75be4add49..a376285a6d1da25b0722aac8657fa55a5b9a5021 100644 (file)
@@ -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;
 }