]> granicus.if.org Git - strace/commitdiff
2003-01-10 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Fri, 10 Jan 2003 19:55:28 +0000 (19:55 +0000)
committerRoland McGrath <roland@redhat.com>
Fri, 10 Jan 2003 19:55:28 +0000 (19:55 +0000)
* strace.c (pfd2tcb): Fix for new tcbtab type.
(rebuild_pollv): Likewise.
(detach): Put variables used under [LINUX] inside #ifdef.

strace.c

index 8f0f7dcf4f23153be53e30a04045c8ed8c782117..2ffa3c60a177f52c343af3f0de5c44af87ffce0d 100644 (file)
--- 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;