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

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