Skip to content

Commit

Permalink
Repair colors on Windows (don't test uv_tty_init() return value)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spudz76 committed Jul 9, 2019
1 parent 06930e6 commit f7ae06d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/common/log/ConsoleLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f7ae06d

Please sign in to comment.