Browse Source

make --run ignore SIGINT

feature/new-parser
Martin Dørum 3 years ago
parent
commit
6381bfb785
3 changed files with 6 additions and 0 deletions
  1. 1
    0
      cmd/main.cc
  2. 4
    0
      lib/sys.cc
  3. 1
    0
      lib/sys.h

+ 1
- 0
cmd/main.cc View File

@@ -103,6 +103,7 @@ static void run(Conf conf) {
argv.push_back(std::move(arg));
}
try {
sys::ignoreCtrlC();
sys::execute(argv, true);
} catch (std::exception &ex) {
logger::log(ex.what());

+ 4
- 0
lib/sys.cc View File

@@ -299,4 +299,8 @@ std::string dirname(const std::string &path) {
return std::string(dir);
}

void ignoreCtrlC() {
signal(SIGINT, SIG_IGN);
}

}

+ 1
- 0
lib/sys.h View File

@@ -29,5 +29,6 @@ void chdir(const std::string &path);
std::string cwd();
void symlink(const std::string &from, const std::string &to);
std::string dirname(const std::string &path);
void ignoreCtrlC();

}

Loading…
Cancel
Save