1 |
douglas |
402 |
// Spectre 2 |
2 |
|
|
// |
3 |
|
|
// Douglas Thrift |
4 |
|
|
// |
5 |
|
|
// $Id$ |
6 |
|
|
|
7 |
|
|
#include "SignalHandler.hpp" |
8 |
|
|
|
9 |
douglas |
404 |
#include <menes-api/posix/error.hpp> |
10 |
|
|
|
11 |
douglas |
402 |
SignalHandler::SignalHandler(Daemon* daemons[], size_t size) : daemons(daemons, size) |
12 |
|
|
{ |
13 |
douglas |
404 |
// api::Posix::CheckError(::signal(SIGHUP, (etl::BindAll(&SignalHandler::reload, this)))); |
14 |
|
|
// api::Posix::CheckError(::signal(SIGTERM, etl::BindAll(&SignalHandler::stop, this))); |
15 |
douglas |
402 |
} |
16 |
|
|
|
17 |
|
|
void SignalHandler::reload(int signal) |
18 |
|
|
{ |
19 |
|
|
_mforeach (ext::Vector<Daemon*>, daemon, daemons) (*daemon)->reload(); |
20 |
|
|
} |
21 |
|
|
|
22 |
|
|
void SignalHandler::stop(int signal) |
23 |
|
|
{ |
24 |
|
|
_mforeach (ext::Vector<Daemon*>, daemon, daemons) (*daemon)->stop(); |
25 |
|
|
} |