Various fixes and improvements, backported from Pro version. Code by Erik Zandvliet.

This commit is contained in:
Thulinma 2015-11-05 17:05:21 +01:00
parent 5cce37c521
commit b28a619fc6
13 changed files with 383 additions and 550 deletions

View file

@ -434,7 +434,7 @@ void Util::Config::activate() {
}
struct sigaction new_action;
struct sigaction cur_action;
new_action.sa_handler = signal_handler;
new_action.sa_sigaction = signal_handler;
sigemptyset(&new_action.sa_mask);
new_action.sa_flags = 0;
sigaction(SIGINT, &new_action, NULL);
@ -452,7 +452,8 @@ void Util::Config::activate() {
/// Basic signal handler. Sets is_active to false if it receives
/// a SIGINT, SIGHUP or SIGTERM signal, reaps children for the SIGCHLD
/// signal, and ignores all other signals.
void Util::Config::signal_handler(int signum) {
void Util::Config::signal_handler(int signum, siginfo_t * sigInfo, void * ignore) {
HIGH_MSG("Received signal %d from process %d", signum, sigInfo->si_pid);
switch (signum) {
case SIGINT: //these three signals will set is_active to false.
case SIGHUP: