From 114a9b041dc1fe9195d7923d2a5396b97c45e8f3 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 2 Jan 2018 12:24:57 +0700 Subject: [PATCH 1/4] #279 Add missing stdio header --- src/Platform_mac.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Platform_mac.cpp b/src/Platform_mac.cpp index 5e53aacb..ba541f1d 100644 --- a/src/Platform_mac.cpp +++ b/src/Platform_mac.cpp @@ -22,6 +22,7 @@ */ +#include #include #include #include @@ -41,11 +42,11 @@ static inline char *createUserAgent() char *buf = new char[max]; -# ifdef XMRIG_NVIDIA_PROJECT - const int cudaVersion = cuda_get_runtime_version(); - snprintf(buf, max, "%s/%s (Macintosh; Intel Mac OS X) libuv/%s CUDA/%d.%d clang/%d.%d.%d", APP_NAME, APP_VERSION, uv_version_string(), cudaVersion / 1000, cudaVersion % 100, __clang_major__, __clang_minor__, __clang_patchlevel__); -# else - snprintf(buf, max, "%s/%s (Macintosh; Intel Mac OS X) libuv/%s clang/%d.%d.%d", APP_NAME, APP_VERSION, uv_version_string(), __clang_major__, __clang_minor__, __clang_patchlevel__); +# ifdef XMRIG_NVIDIA_PROJECT + const int cudaVersion = cuda_get_runtime_version(); + snprintf(buf, max, "%s/%s (Macintosh; Intel Mac OS X) libuv/%s CUDA/%d.%d clang/%d.%d.%d", APP_NAME, APP_VERSION, uv_version_string(), cudaVersion / 1000, cudaVersion % 100, __clang_major__, __clang_minor__, __clang_patchlevel__); +# else + snprintf(buf, max, "%s/%s (Macintosh; Intel Mac OS X) libuv/%s clang/%d.%d.%d", APP_NAME, APP_VERSION, uv_version_string(), __clang_major__, __clang_minor__, __clang_patchlevel__); # endif return buf; From 1b025f681cdb7dcc7c98fd8cf82ee353e80d2262 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 2 Jan 2018 13:41:00 +0700 Subject: [PATCH 2/4] Remove extra semicolon. --- src/net/Client.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/net/Client.cpp b/src/net/Client.cpp index 88134ae7..8e8ebcfd 100644 --- a/src/net/Client.cpp +++ b/src/net/Client.cpp @@ -582,11 +582,11 @@ void Client::onRead(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) LOG_ERR("[%s:%u] read error: \"%s\"", client->m_url.host(), client->m_url.port(), uv_strerror((int) nread)); } - return client->close();; + return client->close(); } if ((size_t) nread > (sizeof(m_buf) - 8 - client->m_recvBufPos)) { - return client->close();; + return client->close(); } client->m_recvBufPos += nread; @@ -623,7 +623,7 @@ void Client::onResolved(uv_getaddrinfo_t *req, int status, struct addrinfo *res) auto client = getClient(req->data); if (status < 0) { LOG_ERR("[%s:%u] DNS error: \"%s\"", client->m_url.host(), client->m_url.port(), uv_strerror(status)); - return client->reconnect();; + return client->reconnect(); } addrinfo *ptr = res; From 785df621833319b380f1af2ee936a6bb05be2a9e Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 2 Jan 2018 13:49:31 +0700 Subject: [PATCH 3/4] Update README.md. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 50ab830b..b4880b38 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # XMRig -XMRig is high performance Monero (XMR) CPU miner, with the official full Windows support. -Originally based on cpuminer-multi with heavy optimizations/rewrites and removing a lot of legacy code, since version 1.0.0 complete rewritten from scratch on C++. +XMRig is a high performance Monero (XMR) CPU miner, with official support for Windows. +Originally based on cpuminer-multi with heavy optimizations/rewrites and removing a lot of legacy code, since version 1.0.0 completely rewritten from scratch on C++. * This is the **CPU-mining** version, there is also a [NVIDIA GPU version](https://github.com/xmrig/xmrig-nvidia) and [AMD GPU version]( https://github.com/xmrig/xmrig-amd). * [Roadmap](https://github.com/xmrig/xmrig/issues/106) for next releases. @@ -89,7 +89,7 @@ Since version 0.8.0. ## Common Issues ### HUGE PAGES unavailable * Run XMRig as Administrator. -* Since version 0.8.0 XMRig automatically enable SeLockMemoryPrivilege for current user, but reboot or sign out still required. [Manual instruction](https://msdn.microsoft.com/en-gb/library/ms190730.aspx). +* Since version 0.8.0 XMRig automatically enables SeLockMemoryPrivilege for current user, but reboot or sign out still required. [Manual instruction](https://msdn.microsoft.com/en-gb/library/ms190730.aspx). ## Other information * No HTTP support, only stratum protocol support. @@ -106,7 +106,7 @@ Please note performance is highly dependent on system load. The numbers above ar ### Maximum performance checklist * Idle operating system. * Do not exceed optimal thread count. -* Use modern CPUs with AES-NI instructuon set. +* Use modern CPUs with AES-NI instruction set. * Try setup optimal cpu affinity. * Enable fast memory (Large/Huge pages). From 5b88213f61ac41e62b906595b60ffb62527ff650 Mon Sep 17 00:00:00 2001 From: XMRig Date: Thu, 4 Jan 2018 11:38:32 +0700 Subject: [PATCH 4/4] Fix wrong signal handle. --- src/App.cpp | 10 ++++++---- src/App.h | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/App.cpp b/src/App.cpp index 1aae7ae0..c08a8be2 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -92,7 +92,9 @@ App::App(int argc, char **argv) : m_network = new Network(m_options); - uv_signal_init(uv_default_loop(), &m_signal); + uv_signal_init(uv_default_loop(), &m_sigHUP); + uv_signal_init(uv_default_loop(), &m_sigINT); + uv_signal_init(uv_default_loop(), &m_sigTERM); } @@ -114,9 +116,9 @@ int App::exec() return 0; } - uv_signal_start(&m_signal, App::onSignal, SIGHUP); - uv_signal_start(&m_signal, App::onSignal, SIGTERM); - uv_signal_start(&m_signal, App::onSignal, SIGINT); + uv_signal_start(&m_sigHUP, App::onSignal, SIGHUP); + uv_signal_start(&m_sigINT, App::onSignal, SIGINT); + uv_signal_start(&m_sigTERM, App::onSignal, SIGTERM); background(); diff --git a/src/App.h b/src/App.h index 781f78f2..fcb3b71b 100644 --- a/src/App.h +++ b/src/App.h @@ -60,7 +60,9 @@ private: Httpd *m_httpd; Network *m_network; Options *m_options; - uv_signal_t m_signal; + uv_signal_t m_sigHUP; + uv_signal_t m_sigINT; + uv_signal_t m_sigTERM; };