From: Brion Vibber Date: Fri, 29 Dec 2006 08:16:22 +0000 (+0000) Subject: * Use raw file descriptor in posix_isatty() check to avoid warning on X-Git-Tag: 1.31.0-rc.0~54748 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=dc35c3b933dff3f3e0db22bd5f6a5e8d0969a49e;p=lhc%2Fweb%2Fwiklou.git * Use raw file descriptor in posix_isatty() check to avoid warning on 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. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8d4745c417..3aa48944db 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/install-utils.inc b/install-utils.inc index fa7b80e580..84fbc8e86d 100644 --- a/install-utils.inc +++ b/install-utils.inc @@ -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;