From e386a814ae0aa231dd0baaed4de7b734e6401f70 Mon Sep 17 00:00:00 2001 From: "Zheng, Gen" Date: Mon, 7 May 2018 16:14:52 +0800 Subject: [PATCH] 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 Reviewed-by: Jason Chen CJ --- devicemodel/core/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devicemodel/core/main.c b/devicemodel/core/main.c index 4deb79a82..e4e568e24 100644 --- a/devicemodel/core/main.c +++ b/devicemodel/core/main.c @@ -648,6 +648,8 @@ main(int argc, char *argv[]) quit_vm_loop = 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) fprintf(stderr, "cannot register handler for SIGINT\n");