Added delay in windows closse of xmrigDaemon when an error occurs

This commit is contained in:
BenDroid 2017-12-04 21:47:47 +01:00
parent 36fc58e6f7
commit 379e25162e
2 changed files with 9 additions and 2 deletions

View file

@ -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);

View file

@ -29,6 +29,8 @@
#define WIN32_LEAN_AND_MEAN /* avoid including junk */
#include <windows.h>
#include <signal.h>
#include <chrono>
#include <thread>
#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
}