From c9b91ca7afbb2b4501ef4945eaef94016ebb25e2 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Mon, 11 Feb 2019 16:29:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_server.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/test_server.cpp b/tests/test_server.cpp index e9d38078..3f82cd6c 100644 --- a/tests/test_server.cpp +++ b/tests/test_server.cpp @@ -228,11 +228,6 @@ static onceToken s_token([](){ #endif int main(int argc,char *argv[]) { - //设置退出信号处理函数 - static semaphore sem; - signal(SIGINT, [](int) { sem.post(); });// 设置退出信号 - signal(SIGHUP, [](int) { loadIniConfig(); }); - //设置日志 Logger::Instance().add(std::make_shared()); Logger::Instance().add(std::make_shared()); @@ -355,6 +350,10 @@ int main(int argc,char *argv[]) { } }); + //设置退出信号处理函数 + static semaphore sem; + signal(SIGINT, [](int) { sem.post(); });// 设置退出信号 + signal(SIGHUP, [](int) { loadIniConfig(); }); sem.wait(); return 0; }