mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-23 01:34:58 +00:00
move SIGINT and SIGTERM handlers to video driver
This commit is contained in:
parent
55b7267694
commit
0337e4fc0f
13
gfx/rpi.c
13
gfx/rpi.c
@ -66,6 +66,14 @@ typedef struct {
|
||||
#endif
|
||||
} rpi_t;
|
||||
|
||||
static bool rpi_shutdown = false;
|
||||
|
||||
static void rpi_kill(int sig)
|
||||
{
|
||||
(void)sig;
|
||||
rpi_shutdown = true;
|
||||
}
|
||||
|
||||
static void rpi_set_nonblock_state(void *data, bool state)
|
||||
{
|
||||
rpi_t *rpi = (rpi_t*)data;
|
||||
@ -211,6 +219,9 @@ static void *rpi_init(const video_info_t *video, const input_driver_t **input, v
|
||||
}
|
||||
#endif
|
||||
|
||||
signal(SIGINT, rpi_kill);
|
||||
signal(SIGTERM, rpi_kill);
|
||||
|
||||
return rpi;
|
||||
}
|
||||
|
||||
@ -402,7 +413,7 @@ static bool rpi_frame(void *data, const void *frame, unsigned width, unsigned he
|
||||
static bool rpi_alive(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
return !rpi_shutdown;
|
||||
}
|
||||
|
||||
static bool rpi_focus(void *data)
|
||||
|
@ -204,10 +204,8 @@ static void *linuxraw_input_init(void)
|
||||
signal(SIGBUS, linuxraw_exitGracefully);
|
||||
signal(SIGFPE, linuxraw_exitGracefully);
|
||||
signal(SIGILL, linuxraw_exitGracefully);
|
||||
signal(SIGINT, linuxraw_exitGracefully);
|
||||
signal(SIGQUIT, linuxraw_exitGracefully);
|
||||
signal(SIGSEGV, linuxraw_exitGracefully);
|
||||
signal(SIGTERM, linuxraw_exitGracefully);
|
||||
|
||||
atexit(linuxraw_resetKbmd);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user