mike Tue, 18 May 2010 07:25:29 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=299437
Log: * fixed bug #49819: STDOUT losing data with posix_isatty() Bug: http://bugs.php.net/49819 (Open) STDOUT losing data with posix_isatty() Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/posix/posix.c U php/php-src/trunk/ext/posix/posix.c Modified: php/php-src/branches/PHP_5_3/NEWS =================================================================== --- php/php-src/branches/PHP_5_3/NEWS 2010-05-18 01:43:37 UTC (rev 299436) +++ php/php-src/branches/PHP_5_3/NEWS 2010-05-18 07:25:29 UTC (rev 299437) @@ -148,6 +148,7 @@ - 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 Modified: php/php-src/branches/PHP_5_3/ext/posix/posix.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/posix/posix.c 2010-05-18 01:43:37 UTC (rev 299436) +++ php/php-src/branches/PHP_5_3/ext/posix/posix.c 2010-05-18 07:25:29 UTC (rev 299437) @@ -703,7 +703,9 @@ 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'", Modified: php/php-src/trunk/ext/posix/posix.c =================================================================== --- php/php-src/trunk/ext/posix/posix.c 2010-05-18 01:43:37 UTC (rev 299436) +++ php/php-src/trunk/ext/posix/posix.c 2010-05-18 07:25:29 UTC (rev 299437) @@ -703,7 +703,9 @@ 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'",
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php