From: Wang Chao Date: Thu, 5 Aug 2010 06:40:45 +0000 (+0800) Subject: Fix error when judging if process has children X-Git-Tag: v4.6~98 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=304ea5f06779a9fd998e7e03d860469853370921;p=strace Fix error when judging if process has children * process.c (internal_wait): Processes counted in tcp->nclone_threads are tcp's threads, rather than tcp's children. Signed-off-by: Wang Chao --- diff --git a/process.c b/process.c index 2d9f9a32..f503ec5c 100644 --- 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