Repair colors on Windows (don't test uv_tty_init() return value)

This commit is contained in:
Tony Butler 2019-07-09 14:18:13 -06:00
parent 3e3d34b3ce
commit d1d4547415

View file

@ -41,10 +41,15 @@ xmrig::ConsoleLog::ConsoleLog()
m_tty = new uv_tty_t; m_tty = new uv_tty_t;
# 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) { if (uv_tty_init(uv_default_loop(), m_tty, 1, 0) < 0) {
Log::setColors(false); Log::setColors(false);
return; return;
} }
# endif
uv_tty_set_mode(m_tty, UV_TTY_MODE_NORMAL); uv_tty_set_mode(m_tty, UV_TTY_MODE_NORMAL);