From 5b88213f61ac41e62b906595b60ffb62527ff650 Mon Sep 17 00:00:00 2001 From: XMRig Date: Thu, 4 Jan 2018 11:38:32 +0700 Subject: [PATCH] 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 1aae7ae09..c08a8be29 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 781f78f25..fcb3b71b7 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; };