diff options
author | silby <silby@FreeBSD.org> | 2003-11-15 02:32:49 +0800 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2003-11-15 02:32:49 +0800 |
commit | 051462c052274bde8824296ac4f8db759acedb46 (patch) | |
tree | a81f6ca957e51bdc502d63fb70f857091446f0df /www/thttpd | |
parent | cd54b82237e9377d934694fc172b6727c677890d (diff) | |
download | freebsd-ports-gnome-051462c052274bde8824296ac4f8db759acedb46.tar.gz freebsd-ports-gnome-051462c052274bde8824296ac4f8db759acedb46.tar.zst freebsd-ports-gnome-051462c052274bde8824296ac4f8db759acedb46.zip |
Fix up mmc_unmap so that it does not try to search on the (unused)
addr field with USE_SENDFILE is defined.
Diffstat (limited to 'www/thttpd')
-rw-r--r-- | www/thttpd/files/patch-mmc.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/www/thttpd/files/patch-mmc.c b/www/thttpd/files/patch-mmc.c index bf2c9f6ed641..c992a3250844 100644 --- a/www/thttpd/files/patch-mmc.c +++ b/www/thttpd/files/patch-mmc.c @@ -1,5 +1,5 @@ ---- mmc.c.orig Wed May 8 03:35:05 2002 -+++ mmc.c Sun Oct 20 23:56:15 2002 +--- mmc.c.orig Tue Oct 22 09:42:01 2002 ++++ mmc.c Fri Nov 14 12:26:39 2003 @@ -74,6 +74,9 @@ time_t ctime; int refcount; @@ -33,7 +33,7 @@ /* Map the file into memory. */ m->addr = mmap( 0, size_size, PROT_READ, MAP_PRIVATE, fd, 0 ); if ( m->addr == (void*) -1 && errno == ENOMEM ) -@@ -240,8 +249,9 @@ +@@ -234,8 +243,9 @@ } #endif /* HAVE_MMAP */ } @@ -44,7 +44,7 @@ /* Put the Map into the hash table. */ if ( add_hash( m ) < 0 ) { -@@ -259,8 +269,12 @@ +@@ -253,8 +263,12 @@ /* Update the total byte count. */ mapped_bytes += m->size; @@ -57,7 +57,26 @@ } -@@ -369,7 +383,9 @@ +@@ -267,14 +281,18 @@ + if ( sbP != (struct stat*) 0 ) + { + m = find_hash( sbP->st_ino, sbP->st_dev, sbP->st_size, sbP->st_ctime ); ++#ifndef USE_SENDFILE + if ( m != (Map*) 0 && m->addr != addr ) + m = (Map*) 0; ++#endif + } ++#ifndef USE_SENDFILE + /* If that didn't work, try a full search. */ + if ( m == (Map*) 0 ) + for ( m = maps; m != (Map*) 0; m = m->next ) + if ( m->addr == addr ) + break; ++#endif + if ( m == (Map*) 0 ) + syslog( LOG_ERR, "mmc_unmap failed to find entry!" ); + else if ( m->refcount <= 0 ) +@@ -363,7 +381,9 @@ m = *mm; if ( m->size != 0 ) { |