From 3c38fa3220b3c7750001375518c5817d00de8f36 Mon Sep 17 00:00:00 2001 From: Tony Butler Date: Tue, 9 Jul 2019 13:37:28 -0600 Subject: [PATCH] Repair colors on Windows (don't test uv_tty_init() return value) --- src/common/log/ConsoleLog.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/log/ConsoleLog.cpp b/src/common/log/ConsoleLog.cpp index b10812a6..c22144b3 100644 --- a/src/common/log/ConsoleLog.cpp +++ b/src/common/log/ConsoleLog.cpp @@ -44,10 +44,15 @@ ConsoleLog::ConsoleLog(xmrig::Controller *controller) : m_stream(nullptr), m_controller(controller) { +# ifdef WIN32 + // Windows returns negative numbers even on success, so avoid testing return value + uv_tty_init(uv_default_loop(), &m_tty, 1, 0); +# else if (uv_tty_init(uv_default_loop(), &m_tty, 1, 0) < 0) { Log::colors = false; return; } +# endif uv_tty_set_mode(&m_tty, UV_TTY_MODE_NORMAL); m_uvBuf.base = m_buf;