[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Actually enable mmap. That should improve matters.
Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv19390/src/common
Modified Files:
compat.c
Log Message:
Actually enable mmap. That should improve matters.
Index: compat.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/compat.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -p -d -r1.90 -r1.91
--- compat.c 5 Jun 2006 09:07:00 -0000 1.90
+++ compat.c 28 Jun 2006 08:54:32 -0000 1.91
@@ -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;
}