* Use raw file descriptor in posix_isatty() check to avoid warning on
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 29 Dec 2006 08:16:22 +0000 (08:16 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 29 Dec 2006 08:16:22 +0000 (08:16 +0000)
  Linux systems with at least some versions of PHP

For some reason posix_isatty(STDIN) prints a warning on Linux about being unable to seek, though it gives the right return value and has no obvious ill effects otherwise.
No such warning appears on Mac OS X.
Using the raw file descriptor number (0 for stdin) seems to work, and is already used in the parser test framework where it checks stdout (1) this way.

RELEASE-NOTES
install-utils.inc

index 8d4745c..3aa4894 100644 (file)
@@ -421,6 +421,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   parser tests when Chinese tables were getting loaded into Serbian code.
 * (bug 8380) Be nicer about blank lines in deleteBatch.php
 * (bug 8401) Fix regression in SORBS lookup for some DNS setups
+* Use raw file descriptor in posix_isatty() check to avoid warning on
+  Linux systems with at least some versions of PHP
 
 
 == Languages updated ==
index fa7b80e..84fbc8e 100644 (file)
@@ -63,7 +63,7 @@ function copydirectory( $source, $dest ) {
 function readconsole( $prompt = '' ) {
        static $isatty = null;
        if ( is_null( $isatty ) ) {
-               if ( !function_exists( 'posix_isatty' ) || posix_isatty( STDIN ) ) {
+               if ( !function_exists( 'posix_isatty' ) || posix_isatty( 0 /*STDIN*/ ) ) {
                        $isatty = true;
                } else {
                        $isatty = false;