From dc35c3b933dff3f3e0db22bd5f6a5e8d0969a49e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 29 Dec 2006 08:16:22 +0000 Subject: [PATCH] * 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. --- RELEASE-NOTES | 2 ++ install-utils.inc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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; -- 2.20.1