From cdffe2388ea2dbafd4c82e304fc228eaefe4ac94 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 27 Jan 2024 20:13:01 +0100 Subject: Rollback vfork changes, it broke SlayTheSpire, and probably other too (for #1221) --- src/emu/x64int3.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/emu/x64int3.c b/src/emu/x64int3.c index 10bd1c95..c287d18d 100644 --- a/src/emu/x64int3.c +++ b/src/emu/x64int3.c @@ -48,8 +48,8 @@ x64emu_t* x64emu_fork(x64emu_t* emu, int forktype) iFpppp_t forkpty = (iFpppp_t)emu->forkpty_info->f; v = forkpty(emu->forkpty_info->amaster, emu->forkpty_info->name, emu->forkpty_info->termp, emu->forkpty_info->winp); emu->forkpty_info = NULL; - } else if(forktype==3) - v = vfork(); + } /*else if(forktype==3) + v = vfork();*/ else v = fork(); /*if(type == EMUTYPE_MAIN) @@ -61,7 +61,10 @@ x64emu_t* x64emu_fork(x64emu_t* emu, int forktype) for (int i=0; iatfork_sz; --i) if(my_context->atforks[i].parent) EmuCall(emu, my_context->atforks[i].parent); - + if(forktype==3) { + // vfork, the parent wait the end or execve of the son + waitpid(v, NULL, WEXITED); + } } else if(v==0) { ResetSegmentsCache(emu); // execute atforks child functions -- cgit 1.4.1