Skip to contentSkip to conversation

linux-user: Fix fork() and vfork()

PATCH In review Tim Hentenaar 2 participants 2 messages Feb 28, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: Fix fork() and vfork()

A check was introduced in 5ea2fc84da1bffce749c9d0848f5336def2818bb which causes fork() and vfork() to fail if TARGET_SIGCHLD != SIGCHLD.

---
 linux-user/syscall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
linux-user/syscall.c +2 -2
index f569f82..ac4106a 100644
@@ -7680,7 +7680,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         break;
 #ifdef TARGET_NR_fork
     case TARGET_NR_fork:
-        ret = get_errno(do_fork(cpu_env, SIGCHLD, 0, 0, 0, 0));
+        ret = get_errno(do_fork(cpu_env, TARGET_SIGCHLD, 0, 0, 0, 0));
         break;
 #endif
 #ifdef TARGET_NR_waitpid
@@ -10490,7 +10490,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
 #endif
 #ifdef TARGET_NR_vfork
     case TARGET_NR_vfork:
-        ret = get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | SIGCHLD,
+        ret = get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | TARGET_SIGCHLD,
                         0, 0, 0, 0));
         break;
 #endif
Signature · 1 line
2.10.2
#1 lore raw
Quoted 7 lines · Tim Hentenaar

A check was introduced in 5ea2fc84da1bffce749c9d0848f5336def2818bb which causes fork() and vfork() to fail if TARGET_SIGCHLD != SIGCHLD.

---
 linux-user/syscall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Thanks for this patch. In fact the equivalent bugfix has just hit QEMU git master, as commit 7eddb5ddacb783ba.

thanks
-- PMM