DM: bug fix in handling signal

With curren code, DM will ignore the SIGHUP signal generated from
SOS reboot that causes DM will not release resource when SOS reboot
occurs.

Signed-off-by: Zheng, Gen <gen.zheng@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Zheng, Gen 2018-05-07 16:14:52 +08:00 committed by Jack Ren
parent 2550d719d3
commit e386a814ae
1 changed files with 2 additions and 0 deletions

View File

@ -648,6 +648,8 @@ main(int argc, char *argv[])
quit_vm_loop = 0; quit_vm_loop = 0;
hugetlb = 0; hugetlb = 0;
if (signal(SIGHUP, sig_handler_term) == SIG_ERR)
fprintf(stderr, "cannot register handler for SIGHUP\n");
if (signal(SIGINT, sig_handler_term) == SIG_ERR) if (signal(SIGINT, sig_handler_term) == SIG_ERR)
fprintf(stderr, "cannot register handler for SIGINT\n"); fprintf(stderr, "cannot register handler for SIGINT\n");