]> granicus.if.org Git - strace/commitdiff
Fix error when judging if process has children
authorWang Chao <wang.chao@cn.fujitsu.com>
Thu, 5 Aug 2010 06:40:45 +0000 (14:40 +0800)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 9 Aug 2010 21:29:00 +0000 (21:29 +0000)
* process.c (internal_wait): Processes counted in tcp->nclone_threads
are tcp's threads, rather than tcp's children.

Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
process.c

index 2d9f9a32a14b6f9f832850f7d7aae8a014b3057e..f503ec5c27510b7dcbe5169af3952e4678102e65 100644 (file)
--- a/process.c
+++ b/process.c
@@ -1922,9 +1922,9 @@ int flagarg;
        if (tcp->flags & TCB_CLONE_THREAD)
                /* The children we wait for are our parent's children.  */
                got_kids = (tcp->parent->nchildren
-                           > tcp->parent->nclone_detached);
+                           > (tcp->parent->nclone_detached + tcp->parent->nclone_threads));
        else
-               got_kids = (tcp->nchildren > tcp->nclone_detached);
+               got_kids = (tcp->nchildren > (tcp->nclone_detached + tcp->nclone_threads));
 #else
        got_kids = tcp->nchildren > 0;
 #endif