mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-10-01 00:50:15 -04:00
[Server] Fix Windows build by not using sigaction on Windows
This commit is contained in:
parent
a13cef9913
commit
76f3805e16
@ -500,16 +500,20 @@ int Networking::mainLoop()
|
|||||||
{
|
{
|
||||||
RakNet::Packet *packet;
|
RakNet::Packet *packet;
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
struct sigaction sigIntHandler;
|
struct sigaction sigIntHandler;
|
||||||
|
|
||||||
sigIntHandler.sa_handler = signalHandler;
|
sigIntHandler.sa_handler = signalHandler;
|
||||||
sigemptyset(&sigIntHandler.sa_mask);
|
sigemptyset(&sigIntHandler.sa_mask);
|
||||||
sigIntHandler.sa_flags = 0;
|
sigIntHandler.sa_flags = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
while (running and !killLoop)
|
while (running and !killLoop)
|
||||||
{
|
{
|
||||||
|
#ifndef _WIN32
|
||||||
sigaction(SIGTERM, &sigIntHandler, NULL);
|
sigaction(SIGTERM, &sigIntHandler, NULL);
|
||||||
sigaction(SIGINT, &sigIntHandler, NULL);
|
sigaction(SIGINT, &sigIntHandler, NULL);
|
||||||
|
#endif
|
||||||
if (kbhit() && getch() == '\n')
|
if (kbhit() && getch() == '\n')
|
||||||
break;
|
break;
|
||||||
for (packet=peer->Receive(); packet; peer->DeallocatePacket(packet), packet=peer->Receive())
|
for (packet=peer->Receive(); packet; peer->DeallocatePacket(packet), packet=peer->Receive())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user