From 96fc260488c22ce294a05d92aaafd22db8cf4251 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 29 Oct 2015 15:03:48 +0100 Subject: [PATCH] linux: restore default INT/TERM signal handler Allow to use CTRL-C to quit PCSX2 ("regression" of SDL2) --- plugins/onepad/SDL/joystick.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/onepad/SDL/joystick.cpp b/plugins/onepad/SDL/joystick.cpp index 2a7b4a945d..3577277b61 100644 --- a/plugins/onepad/SDL/joystick.cpp +++ b/plugins/onepad/SDL/joystick.cpp @@ -20,6 +20,7 @@ */ #include "joystick.h" +#include // sigaction ////////////////////////// // Joystick definitions // @@ -51,6 +52,11 @@ void JoystickInfo::EnumerateJoysticks(vector& vjoysticks) // Tell SDL to catch event even if the windows isn't focussed SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); if (SDL_Init(SDL_INIT_JOYSTICK|SDL_INIT_HAPTIC|SDL_INIT_EVENTS) < 0) return; + // WTF! Give me back the control of my system + struct sigaction action; + action.sa_handler = SIG_DFL; + sigaction(SIGINT, &action, NULL); + sigaction(SIGTERM, &action, NULL); #else if (SDL_Init(SDL_INIT_JOYSTICK) < 0) return; #endif