diff options
author | Michael Wallner <mike@php.net> | 2010-05-18 07:25:29 +0000 |
---|---|---|
committer | Michael Wallner <mike@php.net> | 2010-05-18 07:25:29 +0000 |
commit | a1de9f382a338d6a8380a7aafd19771c742a100d (patch) | |
tree | ff6455b86c92e08a9c161c340aaf311a9c03035b | |
parent | 50a1b1d06cc2f9eb219a8bc7ca9130e08e761965 (diff) | |
download | php-git-a1de9f382a338d6a8380a7aafd19771c742a100d.tar.gz |
* fixed bug #49819: STDOUT losing data with posix_isatty()
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | ext/posix/posix.c | 4 |
2 files changed, 4 insertions, 1 deletions
@@ -148,6 +148,7 @@ PHP NEWS - Fixed bug #50358 (Compile failure compiling ext/phar/util.lo). (Felipe) - Fixed bug #49893 (Crash while creating an instance of Zend_Mail_Storage_Pop3). (Dmitry) +- Fixed bug #49819 (STDOUT losing data with posix_isatty()). (Mike) - Fixed bug #49778 (DateInterval::format("%a") is always zero when an interval is created from an ISO string). (Derick) - Fixed bug #49700 (memory leaks in php_date.c if garbage collector is diff --git a/ext/posix/posix.c b/ext/posix/posix.c index f030356fb8..01f8d407fd 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'", |