From: foobar Date: Tue, 2 Sep 2003 01:23:21 +0000 (+0000) Subject: MFH: - Fixed bug #25343 (is_dir() gives warning on FreeBSD). X-Git-Tag: php-4.3.4RC1~128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b485be88daafdf64699c01fbd71cc7ff85261ff3;p=php MFH: - Fixed bug #25343 (is_dir() gives warning on FreeBSD). --- diff --git a/NEWS b/NEWS index a373f25bb2..f28dab52f3 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ PHP 4 NEWS - Fixed disk_total_space() and disk_free_space() under FreeBSD. (Jon Parise) - Fixed crash bug when non-existing save/serializer handler was used. (Jani) - Fixed memory leak in gethostbynamel() if an error occurs. (Sara) +- Fixed bug #25343 (is_dir() gives warning on FreeBSD). (Jani) - Fixed bug #25308 (php -m crashes when zend extensions are loaded). (Stas) - Fixed bug #25307 (Crash with WDDX serializer). (Sascha, Jani) - Fixed bug #25239 (ftp_fopen_wrapper not RFC compliant). (Sara) diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index e199583d47..ea7b42a1e5 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -610,7 +610,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ BG(lsb).st_mode = 0; /* mark lstat buf invalid */ #endif if (VCWD_STAT(BG(CurrentStatFile), &BG(sb)) == -1) { - if (!IS_LINK_OPERATION(type) && (!IS_EXISTS_CHECK(type) || errno != ENOENT)) { /* fileexists() test must print no error */ + if (!IS_LINK_OPERATION(type) && (!IS_EXISTS_CHECK(type) || (errno != ENOENT && errno != ENOTDIR))) { /* fileexists() test must print no error */ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Stat failed for %s (errno=%d - %s)", BG(CurrentStatFile), errno, strerror(errno)); } efree(BG(CurrentStatFile)); @@ -626,7 +626,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ if (IS_LINK_OPERATION(type) && !BG(lsb).st_mode) { /* do lstat if the buffer is empty */ if (VCWD_LSTAT(filename, &BG(lsb)) == -1) { - if (!IS_EXISTS_CHECK(type) || errno != ENOENT) { /* fileexists() test must print no error */ + if (!IS_EXISTS_CHECK(type) || (errno != ENOENT && errno != ENOTDIR)) { /* fileexists() test must print no error */ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Lstat failed for %s (errno=%d - %s)", BG(CurrentStatFile), errno, strerror(errno)); } RETURN_FALSE;