Skip to content

Commit e386a81

Browse files
zhenggenjren1
authored andcommitted
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>
1 parent 2550d71 commit e386a81

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

devicemodel/core/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,8 @@ main(int argc, char *argv[])
648648
quit_vm_loop = 0;
649649
hugetlb = 0;
650650

651+
if (signal(SIGHUP, sig_handler_term) == SIG_ERR)
652+
fprintf(stderr, "cannot register handler for SIGHUP\n");
651653
if (signal(SIGINT, sig_handler_term) == SIG_ERR)
652654
fprintf(stderr, "cannot register handler for SIGINT\n");
653655

0 commit comments

Comments
 (0)