From: notaz Date: Wed, 13 Mar 2013 22:16:04 +0000 (+0200) Subject: frontend: exit immediately on signals X-Git-Tag: r19~7 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee1a37fd6ae23862dfcdb06958e8f686ce1a5519;p=pcsx_rearmed.git frontend: exit immediately on signals .. and only hook them when compiled with frontend --- diff --git a/frontend/main.c b/frontend/main.c index df2af8f2..09f6a1cc 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -680,6 +680,12 @@ static void toggle_fast_forward(int force_off) snprintf(hud_msg, sizeof(hud_msg), "FAST FORWARD %s", fast_forward ? "ON" : "OFF"); } + +static void SignalExit(int sig) { + // only to restore framebuffer/resolution on some devices + plat_finish(); + exit(1); +} #endif void SysRunGui() { @@ -813,10 +819,6 @@ void SysMessage(const char *fmt, ...) { SysPrintf("%s\n", msg); } -static void SignalExit(int sig) { - emu_core_ask_exit(); -} - #define PARSEPATH(dst, src) \ ptr = src + strlen(src); \ while (*ptr != '\\' && ptr != src) ptr--; \ @@ -827,8 +829,10 @@ static void SignalExit(int sig) { static int _OpenPlugins(void) { int ret; +#ifndef NO_FRONTEND signal(SIGINT, SignalExit); signal(SIGPIPE, SignalExit); +#endif GPU_clearDynarec(clearDynarec); @@ -919,8 +923,11 @@ int OpenPlugins() { void ClosePlugins() { int ret; +#ifndef NO_FRONTEND signal(SIGINT, SIG_DFL); signal(SIGPIPE, SIG_DFL); +#endif + ret = CDR_close(); if (ret < 0) { SysMessage(_("Error closing CD-ROM plugin!")); return; } ret = SPU_close();