feat: handle ctrl-c for this program
This commit is contained in:
11
src/main.cxx
11
src/main.cxx
@@ -1,3 +1,7 @@
|
|||||||
|
#include <csignal>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
|
||||||
#include "Parser.h"
|
#include "Parser.h"
|
||||||
#include "Parser.h"
|
#include "Parser.h"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
@@ -9,6 +13,10 @@
|
|||||||
#include "log/log.h"
|
#include "log/log.h"
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
|
|
||||||
|
void handle_ctrlC(int signal){
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
/* 0 is data path.
|
/* 0 is data path.
|
||||||
1 is dataRef path.
|
1 is dataRef path.
|
||||||
2 is output path.
|
2 is output path.
|
||||||
@@ -17,6 +25,9 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
signal(SIGINT, handle_ctrlC);
|
||||||
|
|
||||||
|
|
||||||
int argNum = 5;
|
int argNum = 5;
|
||||||
std::vector<std::string> args(argNum);
|
std::vector<std::string> args(argNum);
|
||||||
args[0] = "/home/sun/20230418T145123/";
|
args[0] = "/home/sun/20230418T145123/";
|
||||||
|
|||||||
Reference in New Issue
Block a user