sniper Mon Sep 1 21:22:03 2003 EDT
Modified files:
/php-src/ext/standard filestat.c
Log:
- Fixed bug #25343 (is_dir() gives warning on FreeBSD).
Index: php-src/ext/standard/filestat.c
diff -u php-src/ext/standard/filestat.c:1.125 php-src/ext/standard/filestat.c:1.126
--- php-src/ext/standard/filestat.c:1.125 Thu Aug 21 02:24:17 2003
+++ php-src/ext/standard/filestat.c Mon Sep 1 21:22:02 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filestat.c,v 1.125 2003/08/21 06:24:17 jon Exp $ */
+/* $Id: filestat.c,v 1.126 2003/09/02 01:22:02 sniper Exp $ */
#include "php.h"
#include "safe_mode.h"
@@ -607,7 +607,7 @@
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 @@
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;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php