com php-src: unify behavior: ext/standard/streamsfuncs.c
| From: | Anatol Belski | Date: | Thu, 13 Apr 2017 10:50:18 +0000 |
| Subject: | com php-src: unify behavior: ext/standard/streamsfuncs.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-97577@lists.php.net to get a copy of this message | ||
Commit: 858ad8a59853bddb1612a9958bfe8b792c4a81ce
Author: Anatol Belski <ab@php.net> 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
}