minor changes

This commit is contained in:
Shengliang Guan 2020-09-14 23:52:02 +08:00
parent 9545741546
commit c8cf072082
1 changed files with 13 additions and 0 deletions

View File

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