handle SIGTERM signal

Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
This commit is contained in:
zhoufeng 2020-11-08 15:00:35 +08:00
parent 507381b8c7
commit 645c562f73
1 changed files with 1 additions and 0 deletions

View File

@ -35,6 +35,7 @@ void RegisterHandlers() {
(void)sigemptyset(&new_int_action.sa_mask); (void)sigemptyset(&new_int_action.sa_mask);
new_int_action.sa_flags = SA_RESTART | SA_SIGINFO; new_int_action.sa_flags = SA_RESTART | SA_SIGINFO;
(void)sigaction(SIGINT, &new_int_action, nullptr); (void)sigaction(SIGINT, &new_int_action, nullptr);
(void)sigaction(SIGTERM, &new_int_action, nullptr);
} }
extern void IntHandler(int sig_num, // The signal that was raised extern void IntHandler(int sig_num, // The signal that was raised