aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authornotaz2013-03-14 00:16:04 +0200
committernotaz2013-03-15 02:19:21 +0200
commitee1a37fd6ae23862dfcdb06958e8f686ce1a5519 (patch)
treea53328e9cde15c40ce74fde0b98424cecda7f271 /frontend
parent2177c1ea9af71647a43a38d2277a7a68429d4f3c (diff)
downloadpcsx_rearmed-ee1a37fd6ae23862dfcdb06958e8f686ce1a5519.tar.gz
pcsx_rearmed-ee1a37fd6ae23862dfcdb06958e8f686ce1a5519.tar.bz2
pcsx_rearmed-ee1a37fd6ae23862dfcdb06958e8f686ce1a5519.zip
frontend: exit immediately on signals
.. and only hook them when compiled with frontend
Diffstat (limited to 'frontend')
-rw-r--r--frontend/main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/frontend/main.c b/frontend/main.c
index df2af8f..09f6a1c 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();