-while (true)
- {
- sigfillset(&signalSet);
- int sig = 0;
- sigwait(&signalSet, &sig);
- bool stop = false;
- int status;
- pid_t childPid;
- set<pid_t>::iterator it;
- switch (sig)
- {
- case SIGHUP:
- traffCnt->Reload();
- modIter = modules.begin();
- for (; modIter != modules.end(); ++modIter)
- {
- if (modIter->Reload())
- {
- WriteServLog("Error reloading module '%s': '%s'", modIter->GetPlugin()->GetVersion().c_str(),
- modIter->GetStrError().c_str());
- printfd(__FILE__, "Error reloading module '%s': '%s'\n", modIter->GetPlugin()->GetVersion().c_str(),
- modIter->GetStrError().c_str());
- }
- }
- break;
- case SIGTERM:
- stop = true;
- break;
- case SIGINT:
- stop = true;
- break;
- case SIGPIPE:
- WriteServLog("Broken pipe!");
- break;
- case SIGCHLD:
- childPid = waitpid(-1, &status, WNOHANG);