Fix wrong signal handle.

This commit is contained in:
XMRig 2018-01-04 11:38:32 +07:00
parent 785df62183
commit 5b88213f61
2 changed files with 9 additions and 5 deletions

View file

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

View file

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