]> granicus.if.org Git - strace/commitdiff
2003-01-10 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Fri, 10 Jan 2003 20:14:20 +0000 (20:14 +0000)
committerRoland McGrath <roland@redhat.com>
Fri, 10 Jan 2003 20:14:20 +0000 (20:14 +0000)
* strace.c (droptcb): Clear flags word before calling rebuild_pollv.

strace.c

index 1d5f2ccf27c0a9b187e17d1b051ee6c75e19ee25..b91b02682dce091be3946aa83a5f7345813aed59 100644 (file)
--- 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