mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Don't print anything from signal handler.
Thread sanitizer doesn't like that.
This commit is contained in:
13
src/main.cpp
13
src/main.cpp
@@ -132,25 +132,20 @@ static void GenerateHelp(const char *appname) {
|
||||
|
||||
static void die(int sig) {
|
||||
signal(SIGPIPE, SIG_DFL);
|
||||
|
||||
CUtils::PrintMessage("Exiting on SIG [" + CString(sig) + "]");
|
||||
|
||||
CZNC::DestroyInstance();
|
||||
exit(sig);
|
||||
CZNC::Get().SetConfigState(CZNC::ECONFIG_NEED_QUIT);
|
||||
}
|
||||
|
||||
static void signalHandler(int sig) {
|
||||
switch (sig) {
|
||||
case SIGHUP:
|
||||
CUtils::PrintMessage("Caught SIGHUP");
|
||||
CZNC::Get().SetConfigState(CZNC::ECONFIG_NEED_REHASH);
|
||||
break;
|
||||
case SIGUSR1:
|
||||
CUtils::PrintMessage("Caught SIGUSR1");
|
||||
CZNC::Get().SetConfigState(CZNC::ECONFIG_NEED_VERBOSE_WRITE);
|
||||
break;
|
||||
default:
|
||||
CUtils::PrintMessage("WTF? Signal handler called for a signal it doesn't know?");
|
||||
// WTF? Signal handler called for a signal it doesn't know?
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,5 +447,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
CZNC::DestroyInstance();
|
||||
|
||||
CUtils::PrintMessage("Exiting");
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user