Make needlessly static data local
authorDenys Vlasenko <dvlasenk@redhat.com>
Fri, 19 Aug 2011 22:03:10 +0000 (00:03 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Tue, 23 Aug 2011 10:53:01 +0000 (12:53 +0200)
* syscall.c (get_scno): For POWERPC64 and X86-64, variable currpers
is declared static. But its old data is never used. Convert it
to ordinary local variable.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
syscall.c

index ed7c4b4427d8e7e0a412fec50ceae9c4d6d43ad1..d6d4697f17e687c02d65511f94441c41af4d91fd 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -828,7 +828,10 @@ get_scno(struct tcb *tcp)
 
 #  ifdef POWERPC64
        if (!(tcp->flags & TCB_INSYSCALL)) {
-               static int currpers = -1;
+               /* TODO: speed up strace by not doing this at every syscall.
+                * We only need to do it after execve.
+                */
+               int currpers;
                long val;
                int pid = tcp->pid;
 
@@ -878,7 +881,10 @@ get_scno(struct tcb *tcp)
                return -1;
 
        if (!(tcp->flags & TCB_INSYSCALL)) {
-               static int currpers = -1;
+               /* TODO: speed up strace by not doing this at every syscall.
+                * We only need to do it after execve.
+                */
+               int currpers;
                long val;
                int pid = tcp->pid;