]> granicus.if.org Git - php/commitdiff
* fixed bug #49819: STDOUT losing data with posix_isatty()
authorMichael Wallner <mike@php.net>
Tue, 18 May 2010 07:25:29 +0000 (07:25 +0000)
committerMichael Wallner <mike@php.net>
Tue, 18 May 2010 07:25:29 +0000 (07:25 +0000)
NEWS
ext/posix/posix.c

diff --git a/NEWS b/NEWS
index 918a79b0b30f383fd5f548a9dc800004975bb71a..6940c69c88ee3bb8e7d9eb44a97797f36b850628 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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
index f030356fb85ce9a85a785f9c7ec65d02109ff555..01f8d407fddf9d80b35e2c2d72b3db45cb47fc53 100644 (file)
@@ -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'",