From: Roland McGrath Date: Fri, 10 Jan 2003 19:55:28 +0000 (+0000) Subject: 2003-01-10 Roland McGrath X-Git-Tag: v4.5.18~887 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca16be8be9521b61bd2c5d945aa115519ebcb4da;p=strace 2003-01-10 Roland McGrath * strace.c (pfd2tcb): Fix for new tcbtab type. (rebuild_pollv): Likewise. (detach): Put variables used under [LINUX] inside #ifdef. --- diff --git a/strace.c b/strace.c index 8f0f7dcf..2ffa3c60 100644 --- a/strace.c +++ b/strace.c @@ -959,9 +959,9 @@ pfd2tcb(pfd) int pfd; { int i; - struct tcb *tcp; - for (i = 0, tcp = tcbtab; i < tcbtabsize; i++, tcp++) { + for (i = 0; i < tcbtabsize; i++) { + struct tcb *tcp = tcbtab[i]; if (tcp->pfd != pfd) continue; if (tcp->flags & TCB_INUSE) @@ -1065,7 +1065,9 @@ struct tcb *tcp; int sig; { int error = 0; +#ifdef LINUX int status, resumed; +#endif if (tcp->flags & TCB_BPTSET) sig = SIGKILL; @@ -1341,7 +1343,6 @@ static void rebuild_pollv() { int i, j; - struct tcb *tcp; if (pollv != NULL) free (pollv); @@ -1351,7 +1352,8 @@ rebuild_pollv() exit(1); } - for (i = j = 0, tcp = tcbtab; i < tcbtabsize; i++, tcp++) { + for (i = j = 0; i < tcbtabsize; i++) { + struct tcb *tcp = tcbtab[i]; if (!(tcp->flags & TCB_INUSE)) continue; pollv[j].fd = tcp->pfd;