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