[PATCH] Fix error when judging if process has children

Dmitry V. Levin ldv at altlinux.org
Mon Aug 9 21:44:01 UTC 2010


On Thu, Aug 05, 2010 at 02:40:45PM +0800, Wang Chao wrote:
> * process.c (internal_wait): processes counted in tcp->nclone_threads
> are tcp's threads, rather than tcp's children.

Looks OK to me, but see my comment below.

> -		got_kids = (tcp->nchildren > tcp->nclone_detached);
> +		got_kids = (tcp->nchildren > (tcp->nclone_detached + tcp->nclone_threads));

There is a possibility to count a process with both CLONE_THREAD and
CLONE_DETACHED flags set twice, but I'm doubt that such a combination of
CLONE_ flags is real, since CLONE_DETACHED is officially no-op in kernel
for a very long time.  Maybe it would be even better to drop this
nclone_detached completely from strace.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20100810/29a83690/attachment.bin>


More information about the Strace-devel mailing list