From 1435dcb94e8d94853c1f2470a970be283b57c27a Mon Sep 17 00:00:00 2001 From: kradchen Date: Fri, 11 Jul 2025 10:41:17 +0800 Subject: [PATCH] feat: handle ctrl-c for this program --- src/main.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.cxx b/src/main.cxx index 074e550..47d234d 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -1,3 +1,7 @@ +#include +#include + + #include "Parser.h" #include "Parser.h" #include @@ -9,6 +13,10 @@ #include "log/log.h" #include "config/config.h" +void handle_ctrlC(int signal){ + exit(0); +} + /* 0 is data path. 1 is dataRef path. 2 is output path. @@ -17,6 +25,9 @@ int main(int argc, char *argv[]) { + signal(SIGINT, handle_ctrlC); + + int argNum = 5; std::vector args(argNum); args[0] = "/home/sun/20230418T145123/";