mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
use compliant sig_atomic_t for signal handler, use _Exit
This commit is contained in:
parent
a69852bdfc
commit
259a449b67
|
@ -50,7 +50,7 @@
|
|||
|
||||
#include <signal.h>
|
||||
|
||||
volatile bool InterruptSignaled = false;
|
||||
volatile sig_atomic_t InterruptSignaled = 0;
|
||||
|
||||
CSnapIDPool::CSnapIDPool()
|
||||
{
|
||||
|
@ -3608,9 +3608,9 @@ static CServer *CreateServer() { return new CServer(); }
|
|||
void HandleSigInt(int Param)
|
||||
{
|
||||
if(InterruptSignaled)
|
||||
exit(1);
|
||||
_Exit(1); // exit is not async-signal-safe and must not be called from a signal handler
|
||||
else
|
||||
InterruptSignaled = true;
|
||||
InterruptSignaled = 1;
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv) // ignore_convention
|
||||
|
|
Loading…
Reference in a new issue