com php-src: unify behavior: ext/standard/streamsfuncs.c

[email protected] (Anatol Belski)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    858ad8a59853bddb1612a9958bfe8b792c4a81ce
Author:    Anatol Belski <[email protected]>         Thu, 13 Apr 2017 12:49:41 +0200
Parents:   93f594831cebf8c384754860830c56c2700c8763
Branches:  master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=858ad8a59853bddb1612a9958bfe8b792c4a81ce

Log:
unify behavior

Changed paths:
  M  ext/standard/streamsfuncs.c


Diff:
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index a9bf574..e74d900 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -1657,13 +1657,11 @@ PHP_FUNCTION(stream_isatty)
 		RETURN_FALSE;
 	}
 #else
-	zend_stat_t stat;
-	if (zend_fstat(fileno, &stat) == 0) {
-		if ((stat.st_mode & /*S_IFMT*/0170000) == /*S_IFCHR*/0020000) {
-			RETURN_TRUE;
-		}
+	zend_stat_t stat = {0};
+	if (zend_fstat(fileno, &stat) == 0 && (stat.st_mode & /*S_IFMT*/0170000) == /*S_IFCHR*/0020000) {
+		RETURN_TRUE;
 	}
-	RETURN_NULL();
+	RETURN_FALSE;
 #endif
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.