mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
tools: allow catching of more signal types
This commit is contained in:
parent
89e769cc53
commit
281f124c1a
2 changed files with 7 additions and 4 deletions
|
@ -48,11 +48,13 @@ protected:
|
|||
virtual void handler(int, siginfo_t *, void *)
|
||||
{ }
|
||||
|
||||
std::list<int> handlerSignals;
|
||||
|
||||
static void printCopyright();
|
||||
static void printVersion();
|
||||
|
||||
public:
|
||||
Tool(int ac, char *av[], const std::string &name);
|
||||
Tool(int ac, char *av[], const std::string &name, const std::list<int> &sigs = { });
|
||||
|
||||
virtual int main()
|
||||
{
|
||||
|
|
|
@ -46,10 +46,11 @@ void Tool::printVersion()
|
|||
std::cout << PROJECT_BUILD_ID << std::endl;
|
||||
}
|
||||
|
||||
Tool::Tool(int ac, char *av[], const std::string &nme) :
|
||||
Tool::Tool(int ac, char *av[], const std::string &nme, const std::list<int> &sigs) :
|
||||
argc(ac),
|
||||
argv(av),
|
||||
name(nme)
|
||||
name(nme),
|
||||
handlerSignals(sigs)
|
||||
{
|
||||
current_tool = this;
|
||||
|
||||
|
@ -65,7 +66,7 @@ int Tool::run()
|
|||
CLR_BLD(CLR_YEL(PROJECT_BUILD_ID)),
|
||||
CLR_BLD(CLR_MAG(__DATE__)), CLR_BLD(CLR_MAG(__TIME__)));
|
||||
|
||||
ret = utils::signals_init(staticHandler);
|
||||
ret = utils::signals_init(staticHandler, handlerSignals);
|
||||
if (ret)
|
||||
throw RuntimeError("Failed to initialize signal subsystem");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue