mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] unconditionally quit on second SIGINT
Under some circumstances, Looking Glass can hang when SIGINT'd, for instance, if it's stuck waiting on spice I/O that won't complete because the guest is misbehaving. This commit provides an escape hatch for such cases, so one doesn't have to reach for `kill -9 $(pidof looking-glass-client)`.
This commit is contained in:
parent
f9ec32b255
commit
941c651fad
@ -1609,14 +1609,23 @@ int eventFilter(void * userdata, SDL_Event * event)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void int_handler(int signal)
|
void int_handler(int sig)
|
||||||
{
|
{
|
||||||
switch(signal)
|
switch(sig)
|
||||||
{
|
{
|
||||||
case SIGINT:
|
case SIGINT:
|
||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
DEBUG_INFO("Caught signal, shutting down...");
|
if (g_state.state != APP_STATE_SHUTDOWN)
|
||||||
g_state.state = APP_STATE_SHUTDOWN;
|
{
|
||||||
|
DEBUG_INFO("Caught signal, shutting down...");
|
||||||
|
g_state.state = APP_STATE_SHUTDOWN;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DEBUG_INFO("Caught second signal, force quitting...");
|
||||||
|
signal(sig, SIG_DFL);
|
||||||
|
raise(sig);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user