]> granicus.if.org Git - php/commitdiff
MFH: - Fixed bug #25343 (is_dir() gives warning on FreeBSD).
authorfoobar <sniper@php.net>
Tue, 2 Sep 2003 01:23:21 +0000 (01:23 +0000)
committerfoobar <sniper@php.net>
Tue, 2 Sep 2003 01:23:21 +0000 (01:23 +0000)
NEWS
ext/standard/filestat.c

diff --git a/NEWS b/NEWS
index a373f25bb29b7fa95f5b97c971a481bc583874b4..f28dab52f32eaf9a122f42755e8a27f0c3ce12e6 100644 (file)
--- 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)
index e199583d47aa3c0dba3916109f9acd0730937cda..ea7b42a1e5f73f6ec9f17e3b7cb23aae9c467bac 100644 (file)
@@ -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;