mirror of
https://github.com/znc/znc.git
synced 2026-08-07 17:33:34 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user