Aufgrund eines Versionsupdates wird GitLab am 01.04. zwischen 9:00 und 9:30 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to a version upgrade, GitLab won't be accessible at 01.04. between 9:00 and 9:30 a.m.

Commit b82ce318 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼

tools: allow catching of more signal types

parent 1986a33e
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment