com php-src: More verbose error messages: ext/opcache/zend_fi le_cache.c
| From: | Dmitry Stogov | Date: | Wed, 09 Dec 2015 10:34:45 +0000 |
| Subject: | com php-src: More verbose error messages: ext/opcache/zend_fi le_cache.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90166@lists.php.net to get a copy of this message | ||
Commit: 4b16082e94d01dd855b2bf8e86a60231b4e8eba4
Author: Dmitry Stogov <dmitry@zend.com> Wed, 9 Dec 2015 13:34:45 +0300
Parents: 25abf2f028171fd89627824ef2c98090a2802361
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4b16082e94d01dd855b2bf8e86a60231b4e8eba4
Log:
More verbose error messages
Changed paths:
M ext/opcache/zend_file_cache.c
Diff:
diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c
index 993358b..ea1db0c 100644
--- a/ext/opcache/zend_file_cache.c
+++ b/ext/opcache/zend_file_cache.c
@@ -1241,9 +1241,16 @@ zend_persistent_script *zend_file_cache_script_load(zend_file_handle
*file_handl
}
/* verify header */
- if (memcmp(info.magic, "OPCACHE", 8) != 0 ||
- memcmp(info.system_id, ZCG(system_id), 32) != 0) {
- zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot read from file '%s'\n",
filename);
+ if (memcmp(info.magic, "OPCACHE", 8) != 0) {
+ zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot read from file '%s' (wrong
header)\n", filename);
+ zend_file_cache_flock(fd, LOCK_UN);
+ close(fd);
+ unlink(filename);
+ efree(filename);
+ return NULL;
+ }
+ if (memcmp(info.system_id, ZCG(system_id), 32) != 0) {
+ zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot read from file '%s' (wrong
\"system_id\")\n", filename);
zend_file_cache_flock(fd, LOCK_UN);
close(fd);
unlink(filename);