about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/emu/x64int3.c9
1 files 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; i<my_context->atfork_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