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

index f0c837198d110065e504fd023d1dddc01cb532ec..50a2c6d11cceb4ed3836e1e198b1446cf8d48092 100644 (file)
@@ -607,7 +607,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_NOTICE, "Stat failed for %s (errno=%d - %s)", BG(CurrentStatFile), errno, strerror(errno));
                        }
                        efree(BG(CurrentStatFile));
@@ -623,7 +623,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_NOTICE, "Lstat failed for %s (errno=%d - %s)", BG(CurrentStatFile), errno, strerror(errno));
                        }
                        RETURN_FALSE;