X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=ginge.git;a=blobdiff_plain;f=loader%2Fhost.c;h=a6c285637831ee85366574f1e65ac79a0ea2a473;hp=546839c9921c86b03fe4939dd0ec869738448878;hb=7868435641e4209e956a591ff0844afc14f83f16;hpb=8424752c5a6e59509c85af7a144ac1849d20f6c5 diff --git a/loader/host.c b/loader/host.c index 546839c..a6c2856 100644 --- a/loader/host.c +++ b/loader/host.c @@ -15,15 +15,17 @@ #include "header.h" #include "realfuncs.h" +// must be affected by realfuncs.h +#include "../common/libpicofe/input.c" +#include "../common/libpicofe/linux/plat.c" +#include "../common/libpicofe/linux/in_evdev.c" + #ifdef PND #include "host_pnd.c" #elif defined(WIZ) #include "host_wiz.c" #endif -// for plat.c -char **g_argv; - int host_init(void) { in_init(); @@ -43,15 +45,21 @@ int host_read_btns(void) return actions[IN_BINDTYPE_PLAYER12]; } -void host_forced_exit(void) +void host_forced_exit(int status) { // 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"); - exit(1); + snprintf(cmd, sizeof(cmd), "killall -9 %s", g_argv[0]); + system(cmd); + exit(status); } // vim:shiftwidth=2:expandtab