cvs: pecl /apc apc_cache.c apc_globals.h
| From: | Gopal Vijayaraghavan | Date: | Mon, 27 Aug 2007 12:53:44 +0000 |
| Subject: | cvs: pecl /apc apc_cache.c apc_globals.h | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-8478@lists.php.net to get a copy of this message | ||
gopalv Mon Aug 27 12:53:44 2007 UTC
Modified files:
/pecl/apc apc_globals.h apc_cache.c
Log:
Move canon_path into TSRM'd globals to enable stat mode to work with ZTS.
http://cvs.php.net/viewvc.cgi/pecl/apc/apc_globals.h?r1=3.64&r2=3.65&diff_format=u
Index: pecl/apc/apc_globals.h
diff -u pecl/apc/apc_globals.h:3.64 pecl/apc/apc_globals.h:3.65
--- pecl/apc/apc_globals.h:3.64 Sat Aug 18 08:19:14 2007
+++ pecl/apc/apc_globals.h Mon Aug 27 12:53:44 2007
@@ -29,7 +29,7 @@
*/
-/* $Id: apc_globals.h,v 3.64 2007/08/18 08:19:14 shire Exp $ */
+/* $Id: apc_globals.h,v 3.65 2007/08/27 12:53:44 gopalv Exp $ */
#ifndef APC_GLOBALS_H
#define APC_GLOBALS_H
@@ -86,6 +86,7 @@
long localcache_size; /* size of fast cache */
apc_local_cache_t* lcache; /* unlocked local cache */
zend_bool force_file_update; /* force files to be updated during apc_compile_file */
+ char canon_path[MAXPATHLEN]; /* canonical path for key data */
ZEND_END_MODULE_GLOBALS(apc)
/* (the following declaration is defined in php_apc.c) */
http://cvs.php.net/viewvc.cgi/pecl/apc/apc_cache.c?r1=3.143&r2=3.144&diff_format=u
Index: pecl/apc/apc_cache.c
diff -u pecl/apc/apc_cache.c:3.143 pecl/apc/apc_cache.c:3.144
--- pecl/apc/apc_cache.c:3.143 Sat Aug 25 13:09:13 2007
+++ pecl/apc/apc_cache.c Mon Aug 27 12:53:44 2007
@@ -28,7 +28,7 @@
*/
-/* $Id: apc_cache.c,v 3.143 2007/08/25 13:09:13 gopalv Exp $ */
+/* $Id: apc_cache.c,v 3.144 2007/08/27 12:53:44 gopalv Exp $ */
#include "apc_cache.h"
#include "apc_lock.h"
@@ -716,7 +716,6 @@
time_t t
TSRMLS_DC)
{
- static char canon_path[MAXPATHLEN]; /* TODO: TSRM */
struct stat *tmp_buf=NULL;
struct apc_fileinfo_t fileinfo = { {0}, };
int len;
@@ -743,13 +742,13 @@
return 0;
}
- if(!realpath(fileinfo.fullpath, canon_path)) {
+ if(!realpath(fileinfo.fullpath, APCG(canon_path))) {
apc_wprint("realpath failed to canonicalize %s - bailing", filename);
return 0;
}
- key->data.fpfile.fullpath = canon_path;
- key->data.fpfile.fullpath_len = strlen(canon_path);
+ key->data.fpfile.fullpath = APCG(canon_path);
+ key->data.fpfile.fullpath_len = strlen(APCG(canon_path));
key->mtime = t;
key->type = APC_CACHE_KEY_FPFILE;
}