mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-10 05:36:22 +08:00
Generalized signal handling. Now handling SIGHUP in addition
to SIGINT and SIGTERM. Setup SIGHUP to reload the server's configuration.
This commit is contained in:
@@ -108,9 +108,20 @@ CArchConsoleWindows::getNewlineForConsole()
|
||||
}
|
||||
|
||||
BOOL WINAPI
|
||||
CArchConsoleWindows::signalHandler(DWORD)
|
||||
CArchConsoleWindows::signalHandler(DWORD ctrlType)
|
||||
{
|
||||
// terminate app and skip remaining handlers
|
||||
ARCH->interrupt();
|
||||
return TRUE;
|
||||
switch (ctrlType) {
|
||||
case CTRL_C_EVENT:
|
||||
ARCH->raiseSignal(CArch::kINTERRUPT);
|
||||
return TRUE;
|
||||
|
||||
case CTRL_BREAK_EVENT:
|
||||
ARCH->raiseSignal(CArch::kTERMINATE);
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
ARCH->raiseSignal(CArch::kINTERRUPT);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user