summaryrefslogtreecommitdiff
path: root/ext/opcache/zend_file_cache.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-12-09 13:34:45 +0300
committerDmitry Stogov <dmitry@zend.com>2015-12-09 13:34:45 +0300
commit4b16082e94d01dd855b2bf8e86a60231b4e8eba4 (patch)
treebc9b5e682ab251ee1009a22ef34e1e22b27c6d39 /ext/opcache/zend_file_cache.c
parent25abf2f028171fd89627824ef2c98090a2802361 (diff)
downloadphp-git-4b16082e94d01dd855b2bf8e86a60231b4e8eba4.tar.gz
More verbose error messages
Diffstat (limited to 'ext/opcache/zend_file_cache.c')
-rw-r--r--ext/opcache/zend_file_cache.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c
index 993358bdf5..ea1db0cd38 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);