From c8cf0720826ec08293c0f2162ddcccbe03bee314 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 14 Sep 2020 23:52:02 +0800 Subject: [PATCH] minor changes --- tests/test/c/httpTest.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test/c/httpTest.c b/tests/test/c/httpTest.c index dd6d9e4cf8..261546770e 100644 --- a/tests/test/c/httpTest.c +++ b/tests/test/c/httpTest.c @@ -19,7 +19,20 @@ #include "taoserror.h" #include "httpSystem.h" +void signal_handler(int signum) { + httpStopSystem(); + httpCleanUpSystem(); + exit(EXIT_SUCCESS); +} + int main(int argc, char *argv[]) { + struct sigaction act; + act.sa_handler = signal_handler; + sigaction(SIGTERM, &act, NULL); + sigaction(SIGHUP, &act, NULL); + sigaction(SIGINT, &act, NULL); + sigaction(SIGABRT, &act, NULL); + // Initialize the system if (httpInitSystem() < 0) { exit(EXIT_FAILURE); -- GitLab