summaryrefslogtreecommitdiff
path: root/ext/posix
diff options
context:
space:
mode:
authorMichael Wallner <mike@php.net>2010-05-18 07:25:29 +0000
committerMichael Wallner <mike@php.net>2010-05-18 07:25:29 +0000
commit50cda403b1cfc71c84536a0f4dad751cf049c4e5 (patch)
tree865ceb6b9209df74f35ce1e24cc5d6328ec06462 /ext/posix
parent6d6b037001cd1184c5589f1bbbb099eaf93f582a (diff)
downloadphp-git-50cda403b1cfc71c84536a0f4dad751cf049c4e5.tar.gz
* fixed bug #49819: STDOUT losing data with posix_isatty()
Diffstat (limited to 'ext/posix')
-rw-r--r--ext/posix/posix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index 7212de3c90..7252e2f0cd 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -703,7 +703,9 @@ static int php_posix_stream_get_fd(zval *zfp, int *fd TSRMLS_DC) /* {{{ */
php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 1 to be a valid stream resource");
return 0;
}
- if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) {
+ if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) {
+ php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)fd, 0);
+ } else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) {
php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)fd, 0);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not use stream of type '%s'",