X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=ginge.git;a=blobdiff_plain;f=loader%2Fhost.c;h=7df4f1092d75621742b6f9b71660858a8f69ea3b;hp=fc7a8296ed68787f39a6359c9c2aa83526fee189;hb=3ef07128a8ad8a12688beee244c5e0a2629581de;hpb=15a2d3ea45a26875a4c1199660c88a5cb6aed070 diff --git a/loader/host.c b/loader/host.c index fc7a829..7df4f10 100644 --- a/loader/host.c +++ b/loader/host.c @@ -1,13 +1,21 @@ -// vim:shiftwidth=2:expandtab - +/* + * GINGE - GINGE Is Not Gp2x Emulator + * (C) notaz, 2010-2011,2015 + * + * This work is licensed under the MAME license, see COPYING file for details. + */ #define _GNU_SOURCE 1 // for plat.c #include #include +#include + +#include "../common/libpicofe/input.h" +#include "../common/libpicofe/linux/in_evdev.h" #include "header.h" #include "realfuncs.h" -#define IN_EVDEV +// must be affected by realfuncs.h #include "../common/libpicofe/input.c" #include "../common/libpicofe/linux/plat.c" #include "../common/libpicofe/linux/in_evdev.c" @@ -24,6 +32,7 @@ char **g_argv; int host_init(void) { in_init(); + host_init_input(); in_probe(); return 0; @@ -44,8 +53,16 @@ void host_forced_exit(void) // exit() might not be enough because loader and app data is out of sync, // and other threads (which are really processes on this old glibc used) // might not exit properly. - system("killall ginge_sloader"); + char cmd[64]; + + printf("forced exit...\n"); + + snprintf(cmd, sizeof(cmd), "killall %s", g_argv[0]); + system(cmd); usleep(300000); - system("killall -9 ginge_sloader"); + snprintf(cmd, sizeof(cmd), "killall -9 %s", g_argv[0]); + system(cmd); exit(1); } + +// vim:shiftwidth=2:expandtab