From b4586bf40ebacac64f821fb4e5d826eeddcd21de Mon Sep 17 00:00:00 2001 From: BenDroid Date: Mon, 4 Dec 2017 21:47:47 +0100 Subject: [PATCH] Added delay in windows closse of xmrigDaemon when an error occurs --- src/App.cpp | 4 ++-- src/cc/XMRigd.cpp | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/App.cpp b/src/App.cpp index 648c1552..791af909 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -120,7 +120,7 @@ App::~App() int App::start() { if (!m_options) { - return 0; + return EINVAL; } uv_signal_start(&m_signal, App::onSignal, SIGHUP); @@ -131,7 +131,7 @@ int App::start() if (!CryptoNight::init(m_options->algo(), m_options->algoVariant())) { LOG_ERR("\"%s\" hash self-test failed.", m_options->algoName()); - return 1; + return EINVAL; } Mem::allocate(m_options); diff --git a/src/cc/XMRigd.cpp b/src/cc/XMRigd.cpp index eed49a4f..1d349206 100644 --- a/src/cc/XMRigd.cpp +++ b/src/cc/XMRigd.cpp @@ -29,6 +29,8 @@ #define WIN32_LEAN_AND_MEAN /* avoid including junk */ #include #include + #include + #include #endif int main(int argc, char **argv) { @@ -55,7 +57,12 @@ int main(int argc, char **argv) { status = system(xmrigMinerPath.c_str()); #ifdef WIN32 } while (status == EINTR); + + if (status == EINVAL) { + std::this_thread::sleep_for(std::chrono::milliseconds(5000)); + } #else } while (WEXITSTATUS(status) == EINTR); #endif } +