From: Roland McGrath Date: Fri, 10 Jan 2003 20:14:20 +0000 (+0000) Subject: 2003-01-10 Roland McGrath X-Git-Tag: v4.5.18~879 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e29341c02f4fb658a34bca1f36c5d587257970d6;p=strace 2003-01-10 Roland McGrath * strace.c (droptcb): Clear flags word before calling rebuild_pollv. --- diff --git a/strace.c b/strace.c index 1d5f2ccf..b91b0268 100644 --- a/strace.c +++ b/strace.c @@ -991,6 +991,18 @@ struct tcb *tcp; nprocs--; tcp->pid = 0; + if (tcp->parent != NULL) { + tcp->parent->nchildren--; +#ifdef TCB_CLONE_THREAD + if (tcp->flags & TCB_CLONE_DETACHED) + tcp->parent->nclone_detached--; + if (tcp->flags & TCB_CLONE_THREAD) + tcp->parent->nclone_threads--; +#endif + tcp->parent = NULL; + } + + tcp->flags = 0; if (tcp->pfd != -1) { close(tcp->pfd); tcp->pfd = -1; @@ -1005,25 +1017,14 @@ struct tcb *tcp; } #endif /* !FREEBSD */ #ifdef USE_PROCFS - rebuild_pollv(); + rebuild_pollv(); /* Note, flags needs to be cleared by now. */ #endif } - if (tcp->parent != NULL) { - tcp->parent->nchildren--; -#ifdef TCB_CLONE_THREAD - if (tcp->flags & TCB_CLONE_DETACHED) - tcp->parent->nclone_detached--; - if (tcp->flags & TCB_CLONE_THREAD) - tcp->parent->nclone_threads--; -#endif - tcp->parent = NULL; - } if (outfname && followfork > 1 && tcp->outf) fclose(tcp->outf); tcp->outf = 0; - tcp->flags = 0; } #ifndef USE_PROCFS