Added SHUTDOWN user command by way of an exception

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@154 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-04-19 18:26:18 +00:00
parent fb2888d007
commit 3fe14f6ed2
3 changed files with 35 additions and 1 deletions
+14 -1
View File
@@ -198,7 +198,20 @@ int main(int argc, char** argv) {
sigaction(SIGSEGV, &sa, (struct sigaction *)NULL);
sigaction(SIGTERM, &sa, (struct sigaction *)NULL);
int iRet = pZNC->Loop();
int iRet = 0;
try {
iRet = pZNC->Loop();
} catch (CException e) {
// EX_Shutdown is thrown to exit
switch (e.GetType()) {
case CException::EX_Shutdown:
iRet = 0;
default:
iRet = 1;
}
}
delete pZNC;
return iRet;