[PATCH] anonMmap fallback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch makes nntpcache retry with a file based mmap if anonMmap
fails.
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Index: src/nmalloc.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/nntpcache/src/nmalloc.c,v
retrieving revision 1.1.1.3
retrieving revision 1.2
diff -u -r1.1.1.3 -r1.2
--- src/nmalloc.c	4 Apr 2002 11:14:54 -0000	1.1.1.3
+++ src/nmalloc.c	19 Oct 2002 04:51:51 -0000	1.2
@@ -92,6 +92,7 @@
 		f_cleanSlate = TRUE;
 	else
 	{
+again:
 		if (con->refreshMmap)
 			unlink(con->mmapFile);
 		else
@@ -129,6 +130,11 @@
 	Mbase = mmalloc_attach (mmapAnon? -1: fd, mmapAnon? 0: Mbase, con->maxMmap);
 	if (!Mbase)
 	{
+		if (mmapAnon) {
+			loge (("anonymous mmap failed, trying again without it"));
+			mmapAnon = FALSE;
+			goto again;
+		}
 		if (fd<0 || f_retried)
 		{
 			loge (("couldn't attach mmap() region. abort."));

[Index of Archives]     [Yosemite]     [Yosemite Campsites]     [Bugtraq]     [Linux]     [Trn]

Powered by Linux