[client] perform proper shutdown on SIGTERM

This commit is contained in:
Geoffrey McRae 2019-04-14 09:15:03 +10:00
parent 972ff93e6c
commit 6f77ba8aea
2 changed files with 6 additions and 3 deletions

View File

@ -1 +1 @@
a12-155-g8cedad8241+1
a12-157-g972ff93e6c+1

View File

@ -845,11 +845,13 @@ int eventFilter(void * userdata, SDL_Event * event)
return 0;
}
void intHandler(int signal)
void int_handler(int signal)
{
switch(signal)
{
case SIGINT:
case SIGTERM:
DEBUG_INFO("Caught signal, shutting down...");
state.running = false;
break;
}
@ -986,7 +988,8 @@ int run()
// override SDL's SIGINIT handler so that we can tell the difference between
// SIGINT and the user sending a close event, such as ALT+F4
signal(SIGINT, intHandler);
signal(SIGINT , int_handler);
signal(SIGTERM, int_handler);
LG_RendererParams lgrParams;
lgrParams.showFPS = params.showFPS;