cvs: pecl /apc INSTALL apc_cache.c
| From: | Rasmus Lerdorf | Date: | Sat, 28 Jun 2003 18:59:40 +0000 |
| Subject: | cvs: pecl /apc INSTALL apc_cache.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-347@lists.php.net to get a copy of this message | ||
rasmus Sat Jun 28 14:59:40 2003 EDT
Modified files:
/pecl/apc INSTALL apc_cache.c
Log:
Fix trivial-case crash
Index: pecl/apc/INSTALL
diff -u pecl/apc/INSTALL:3.31 pecl/apc/INSTALL:3.32
--- pecl/apc/INSTALL:3.31 Sat Jun 28 14:17:20 2003
+++ pecl/apc/INSTALL Sat Jun 28 14:59:40 2003
@@ -243,7 +243,9 @@
this is the mktemp-style file_mask to pass to the
mmap module for determing whether your mmap'ed memory
region is going to be file-backed or shared memory
- backed. To use POSIX-style shm_open/mmap put a ".shm"
+ backed. For straight file-backed mmap, set it to
+ something like /tmp/apc.XXXXXX (exactly 6 X's).
+ To use POSIX-style shm_open/mmap put a ".shm"
somewhere in your mask. eg. "/apc.shm.XXXXXX"
You can also set it to "/dev/zero" to use your
kernel's /dev/zero interface to anonymous mmap'ed
Index: pecl/apc/apc_cache.c
diff -u pecl/apc/apc_cache.c:3.50 pecl/apc/apc_cache.c:3.51
--- pecl/apc/apc_cache.c:3.50 Fri Jun 27 12:19:18 2003
+++ pecl/apc/apc_cache.c Sat Jun 28 14:59:40 2003
@@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: apc_cache.c,v 3.50 2003/06/27 16:19:18 gschlossnagle Exp $ */
+/* $Id: apc_cache.c,v 3.51 2003/06/28 18:59:40 rasmus Exp $ */
#include "apc_cache.h"
#include "apc_lock.h"
@@ -326,7 +326,7 @@
const char* filename,
const char* include_path)
{
- struct stat buf;
+ struct stat buf, *tmp_buf=NULL;
assert(key != NULL);
@@ -334,8 +334,9 @@
return 0;
if(!strcmp(SG(request_info).path_translated, filename)) {
- buf = *sapi_get_stat(); /* Apache has already done this stat() for us */
+ tmp_buf = sapi_get_stat(); /* Apache has already done this stat() for us */
}
+ if(tmp_buf) buf = *tmp_buf;
else if (stat(filename, &buf) != 0 &&
apc_stat_paths(filename, include_path, &buf) != 0)
{