httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject [PATCH] fix mmap error conditions again
Date Thu, 20 Nov 1997 17:24:33 GMT
This is from Ben Hyde.  This fixes the "(0)Unknown error: mmap_handler: 
mmap failed" errors on HEAD requests.

Dean

Index: http_core.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/http_core.c,v
retrieving revision 1.140
diff -u -r1.140 http_core.c
--- http_core.c	1997/11/15 00:16:50	1.140
+++ http_core.c	1997/11/20 17:21:31
@@ -1864,21 +1864,20 @@
     block_alarms();
     if ((r->finfo.st_size >= MMAP_THRESHOLD)
 	&& ( !r->header_only || (d->content_md5 & 1))) {
-      /* we need to protect ourselves in case we die while we've got the
+	/* we need to protect ourselves in case we die while we've got the
  	 * file mmapped */
 	mm = mmap (NULL, r->finfo.st_size, PROT_READ, MAP_PRIVATE,
 		    fileno(f), 0);
+	if (mm == (caddr_t)-1) {
+	    aplog_error(APLOG_MARK, APLOG_CRIT, r->server,
+			"default_handler: mmap failed: %s", r->filename);
+	}
     } else {
 	mm = (caddr_t)-1;
     }
 
     if (mm == (caddr_t)-1) {
 	unblock_alarms();
-
-	if (r->finfo.st_size >= MMAP_THRESHOLD) {
-	    aplog_error(APLOG_MARK, APLOG_CRIT, r->server,
-			"mmap_handler: mmap failed: %s", r->filename);
-	}
 #endif
 
 	if (d->content_md5 & 1) {



Mime
View raw message