return SUCCESS;
}
-PHP_RSHUTDOWN_FUNCTION(filestat) {
+PHP_RSHUTDOWN_FUNCTION(filestat)
+{
if (BG(CurrentStatFile)) {
efree (BG(CurrentStatFile));
}
/* }}} */
#define IS_LINK_OPERATION() (type == 8 /* filetype */ || type == 14 /* is_link */ || type == 16 /* lstat */)
+#define IS_EXISTS_CHECK(__t) ((__t) == FS_EXISTS || (__t) == FS_IS_W || (__t) == FS_IS_R || (__t) == FS_IS_X || (__t) == FS_IS_FILE || (__t) == FS_IS_DIR || (__t) == FS_IS_LINK)
/* {{{ php_stat
*/
BG(lsb).st_mode = 0; /* mark lstat buf invalid */
#endif
if (VCWD_STAT(BG(CurrentStatFile), &BG(sb)) == -1) {
- if (!IS_LINK_OPERATION() && (type != FS_EXISTS || errno != ENOENT)) { /* fileexists() test must print no error */
+ if (!(IS_LINK_OPERATION() && IS_EXISTS_CHECK(type)) || errno != ENOENT) { /* fileexists() test must print no error */
php_error(E_WARNING, "stat failed for %s (errno=%d - %s)", BG(CurrentStatFile), errno, strerror(errno));
}
efree(BG(CurrentStatFile));