From 7004a51ce6a0565043b65466b799ed3e6cffbd48 Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 2 Aug 2017 20:08:41 +0300 Subject: [PATCH 1/5] v2.2.0 --- src/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h b/src/version.h index 08bd362b..cef479b8 100644 --- a/src/version.h +++ b/src/version.h @@ -27,7 +27,7 @@ #define APP_ID "xmrig" #define APP_NAME "XMRig" #define APP_DESC "Monero (XMR) CPU miner" -#define APP_VERSION "2.2.0-dev" +#define APP_VERSION "2.2.0" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2017 xmrig.com" From 816fc3ee43683e224449b6ad2ddbff696d24759e Mon Sep 17 00:00:00 2001 From: XMRig Date: Fri, 4 Aug 2017 11:10:33 +0300 Subject: [PATCH 2/5] Fixed terminal issues after exit on Linux and OS X. --- src/App.cpp | 1 + src/version.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/App.cpp b/src/App.cpp index 4ef8a1a6..2e7b72ff 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -115,6 +115,7 @@ int App::exec() const int r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); uv_loop_close(uv_default_loop()); + uv_tty_reset_mode(); free(m_network); free(m_options); diff --git a/src/version.h b/src/version.h index cef479b8..3d197ee3 100644 --- a/src/version.h +++ b/src/version.h @@ -27,14 +27,14 @@ #define APP_ID "xmrig" #define APP_NAME "XMRig" #define APP_DESC "Monero (XMR) CPU miner" -#define APP_VERSION "2.2.0" +#define APP_VERSION "2.2.1" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2017 xmrig.com" #define APP_VER_MAJOR 2 #define APP_VER_MINOR 2 -#define APP_VER_BUILD 0 +#define APP_VER_BUILD 1 #define APP_VER_REV 0 #ifdef _MSC_VER From 92d787c817dfa92ca38e36f634195f31ff7d40c3 Mon Sep 17 00:00:00 2001 From: xmrig Date: Fri, 4 Aug 2017 11:51:09 +0300 Subject: [PATCH 3/5] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bcf5996..4dfc18bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# v2.2.1 +- Fixed [terminal issues](https://github.com/xmrig/xmrig-proxy/issues/2#issuecomment-319914085) after exit on Linux and OS X. + # v2.2.0 - [#46](https://github.com/xmrig/xmrig/issues/46) Restored config file support. Now possible use multiple config files and combine with command line options also added support for default config. - Improved colors support on Windows, now used uv_tty, legacy code removed. From 1720d3e096696e3947d1225b89016206e4c510df Mon Sep 17 00:00:00 2001 From: XMRig Date: Fri, 4 Aug 2017 21:47:43 +0300 Subject: [PATCH 4/5] Fixed initialization, no need init logs and network if configuration not ready. --- src/App.cpp | 5 ++++- src/Options.cpp | 9 ++++++--- src/Options.h | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/App.cpp b/src/App.cpp index 2e7b72ff..de6f2785 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -59,6 +59,9 @@ App::App(int argc, char **argv) : Cpu::init(); m_options = Options::parse(argc, argv); + if (!m_options) { + return; + } Log::init(); @@ -91,7 +94,7 @@ App::~App() int App::exec() { - if (!m_options->isReady()) { + if (!m_options) { return 0; } diff --git a/src/Options.cpp b/src/Options.cpp index a94af60d..1a1e1c69 100644 --- a/src/Options.cpp +++ b/src/Options.cpp @@ -181,11 +181,14 @@ static char *defaultConfigName() Options *Options::parse(int argc, char **argv) { - if (!m_self) { - m_self = new Options(argc, argv); + Options *options = new Options(argc, argv); + if (options->isReady()) { + m_self = options; + return m_self; } - return m_self; + delete options; + return nullptr; } diff --git a/src/Options.h b/src/Options.h index 0b41f5c4..7a6a7339 100644 --- a/src/Options.h +++ b/src/Options.h @@ -57,7 +57,6 @@ public: inline bool background() const { return m_background; } inline bool colors() const { return m_colors; } inline bool doubleHash() const { return m_doubleHash; } - inline bool isReady() const { return m_ready; } inline bool syslog() const { return m_syslog; } inline const char *logFile() const { return m_logFile; } inline const std::vector &pools() const { return m_pools; } @@ -76,6 +75,8 @@ private: Options(int argc, char **argv); ~Options(); + inline bool isReady() const { return m_ready; } + static Options *m_self; bool parseArg(int key, const char *arg); From 62681adcfb1e412ef701fa11d66165742d74d43d Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 5 Aug 2017 18:45:06 +0300 Subject: [PATCH 5/5] Fixed assert when try read unavailable stdin. --- src/Console.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Console.cpp b/src/Console.cpp index 15c99001..3d95ada4 100644 --- a/src/Console.cpp +++ b/src/Console.cpp @@ -31,8 +31,12 @@ Console::Console(IConsoleListener *listener) { m_tty.data = this; uv_tty_init(uv_default_loop(), &m_tty, 0, 1); - uv_tty_set_mode(&m_tty, UV_TTY_MODE_RAW); + if (!uv_is_readable(reinterpret_cast(&m_tty))) { + return; + } + + uv_tty_set_mode(&m_tty, UV_TTY_MODE_RAW); uv_read_start(reinterpret_cast(&m_tty), Console::onAllocBuffer, Console::onRead); }