aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-11-21 12:08:40 -0500
committerGitHub <noreply@github.com>2022-11-21 12:08:40 -0500
commit4da8a18c8c72a125a3ea4f3842e08757d8dbe321 (patch)
treebf08a80152595ff3fa05a3b22734daffcf6b70e2 /src
parent70a82b07844ce5187ba030110ea84c0e6c07c291 (diff)
downloadminetest-4da8a18c8c72a125a3ea4f3842e08757d8dbe321.tar.xz
Check specific outputs for isatty (#12980)
Diffstat (limited to 'src')
-rw-r--r--src/log.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/log.h b/src/log.h
index 0a84332e7..4255e55bc 100644
--- a/src/log.h
+++ b/src/log.h
@@ -124,9 +124,10 @@ public:
m_stream(stream)
{
#if !defined(_WIN32)
- is_tty = isatty(fileno(stdout));
-#else
- is_tty = false;
+ if (&stream == &std::cout)
+ is_tty = isatty(STDOUT_FILENO);
+ else if (&stream == &std::cerr)
+ is_tty = isatty(STDERR_FILENO);
#endif
}
@@ -134,7 +135,7 @@ public:
private:
std::ostream &m_stream;
- bool is_tty;
+ bool is_tty = false;
};
class FileLogOutput : public ICombinedLogOutput {