From: Pino Toscano Date: Thu, 9 Nov 2017 12:31:03 +0000 (+0100) Subject: tests: fix TTY check in virTestUseTerminalColors() X-Git-Tag: v3.10.0-rc1~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef5c8a91aab695acd8dce19182eb325b0fc65916;p=thirdparty%2Flibvirt.git tests: fix TTY check in virTestUseTerminalColors() Since colors would be used when writing to stdout, then check that stdout is a TTY, instead of stdin. This avoids the usage of terminal color codes when the output is directed to file. --- diff --git a/tests/testutils.c b/tests/testutils.c index 915cd3b792..9266f15e85 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -92,7 +92,7 @@ bool virTestOOMActive(void) static int virTestUseTerminalColors(void) { - return isatty(STDIN_FILENO); + return isatty(STDOUT_FILENO); } static unsigned int