[PATCH] Fix error when judging if process has children
Wang Chao
wang.chao at cn.fujitsu.com
Thu Aug 5 06:40:45 UTC 2010
* 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 at cn.fujitsu.com>
---
process.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/process.c b/process.c
index dadf830..bd8037e 100644
--- a/process.c
+++ b/process.c
@@ -1918,9 +1918,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
--
1.6.5.2
More information about the Strace-devel
mailing list