]> granicus.if.org Git - php/commitdiff
More verbose error messages
authorDmitry Stogov <dmitry@zend.com>
Wed, 9 Dec 2015 10:34:45 +0000 (13:34 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 9 Dec 2015 10:34:45 +0000 (13:34 +0300)
ext/opcache/zend_file_cache.c

index 993358bdf51b9175cf65a4f8372b86be19f255fb..ea1db0cd3804a1e72084a1c8bc1aba7e2209806e 100644 (file)
@@ -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);