Blame SOURCES/valgrind-3.17.0-clone-parent-res.patch

39285c
commit e08a82991a9b9dc87c13f2b89273f25f97d14baf
39285c
Author: Tom Hughes <tom@compton.nu>
39285c
Date:   Tue Apr 6 22:44:36 2021 +0100
39285c
39285c
    Only process clone results in the parent thread
39285c
    
39285c
    Fixes BZ#423963
39285c
39285c
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
39285c
index 5ae4e6613..c59d8ee26 100644
39285c
--- a/coregrind/m_syswrap/syswrap-linux.c
39285c
+++ b/coregrind/m_syswrap/syswrap-linux.c
39285c
@@ -940,7 +940,7 @@ PRE(sys_clone)
39285c
          ("Valgrind does not support general clone().");
39285c
    }
39285c
 
39285c
-   if (SUCCESS) {
39285c
+   if (SUCCESS && RES != 0) {
39285c
       if (ARG_FLAGS & (VKI_CLONE_PARENT_SETTID | VKI_CLONE_PIDFD))
39285c
          POST_MEM_WRITE(ARG3, sizeof(Int));
39285c
       if (ARG_FLAGS & (VKI_CLONE_CHILD_SETTID | VKI_CLONE_CHILD_CLEARTID))