]> granicus.if.org Git - strace/commitdiff
* strace.c (printstatsol, printstat_sparc64):
authorDenys Vlasenko <dvlasenk@redhat.com>
Mon, 20 Apr 2009 18:30:13 +0000 (18:30 +0000)
committerDenys Vlasenko <dvlasenk@redhat.com>
Mon, 20 Apr 2009 18:30:13 +0000 (18:30 +0000)
Remove NULL and error check for addr parameter.
(printoldstat, printstat, printoldstat64):
Move NULL and error check for addr parameter
so that it happens before printstatsol/printstat_sparc64 calls.

ChangeLog
file.c

index 6b1fed5b040bb5448fd760ba2961b53715912919..64bbe50d4eaba32b8c1ec4f2dc5d534313573824 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-20  Denys Vlasenko  <dvlasenk@redhat.com>
+
+       * strace.c (printstatsol, printstat_sparc64):
+       Remove NULL/error check for addr parameter.
+       (printoldstat, printstat, printoldstat64):
+       Move NULL/error check for addr parameter
+       so that it happens before printstatsol/printstat_sparc64 calls.
+
 2009-04-20  Denys Vlasenko  <dvlasenk@redhat.com>
 
        * strace.c (collect_stopped_tcbs): Do not enable/disable signals
diff --git a/file.c b/file.c
index 080e10b0c45dc4f452e1d358b8e3789a2d0836f9..53c2489515047e2429b41f2bb1f0a31f0b902a90 100644 (file)
--- a/file.c
+++ b/file.c
@@ -779,14 +779,6 @@ printstatsol(struct tcb *tcp, long addr)
 {
        struct solstat statbuf;
 
-       if (!addr) {
-               tprintf("NULL");
-               return;
-       }
-       if (syserror(tcp) || !verbose(tcp)) {
-               tprintf("%#lx", addr);
-               return;
-       }
        if (umove(tcp, addr, &statbuf) < 0) {
                tprintf("{...}");
                return;
@@ -831,14 +823,6 @@ printstat_sparc64(struct tcb *tcp, long addr)
 {
        struct stat_sparc64 statbuf;
 
-       if (!addr) {
-               tprintf("NULL");
-               return;
-       }
-       if (syserror(tcp) || !verbose(tcp)) {
-               tprintf("%#lx", addr);
-               return;
-       }
        if (umove(tcp, addr, &statbuf) < 0) {
                tprintf("{...}");
                return;
@@ -1000,6 +984,15 @@ printstat(struct tcb *tcp, long addr)
 {
        struct stat statbuf;
 
+       if (!addr) {
+               tprintf("NULL");
+               return;
+       }
+       if (syserror(tcp) || !verbose(tcp)) {
+               tprintf("%#lx", addr);
+               return;
+       }
+
 #ifdef LINUXSPARC
        if (current_personality == 1) {
                printstatsol(tcp, addr);
@@ -1013,14 +1006,6 @@ printstat(struct tcb *tcp, long addr)
 #endif
 #endif /* LINUXSPARC */
 
-       if (!addr) {
-               tprintf("NULL");
-               return;
-       }
-       if (syserror(tcp) || !verbose(tcp)) {
-               tprintf("%#lx", addr);
-               return;
-       }
        if (umove(tcp, addr, &statbuf) < 0) {
                tprintf("{...}");
                return;
@@ -1068,31 +1053,32 @@ printstat64(struct tcb *tcp, long addr)
 {
        struct stat64 statbuf;
 
-#ifdef STAT64_SIZE
+#ifdef STAT64_SIZE
        (void) sizeof(char[sizeof statbuf == STAT64_SIZE ? 1 : -1]);
 #endif
 
+       if (!addr) {
+               tprintf("NULL");
+               return;
+       }
+       if (syserror(tcp) || !verbose(tcp)) {
+               tprintf("%#lx", addr);
+               return;
+       }
+
 #ifdef LINUXSPARC
        if (current_personality == 1) {
                printstatsol(tcp, addr);
                return;
        }
-#ifdef SPARC64
+# ifdef SPARC64
        else if (current_personality == 2) {
                printstat_sparc64(tcp, addr);
                return;
        }
-#endif
+# endif
 #endif /* LINUXSPARC */
 
-       if (!addr) {
-               tprintf("NULL");
-               return;
-       }
-       if (syserror(tcp) || !verbose(tcp)) {
-               tprintf("%#lx", addr);
-               return;
-       }
        if (umove(tcp, addr, &statbuf) < 0) {
                tprintf("{...}");
                return;
@@ -1200,13 +1186,6 @@ printoldstat(struct tcb *tcp, long addr)
        struct __old_kernel_stat statbuf;
        struct stat newstatbuf;
 
-#ifdef LINUXSPARC
-       if (current_personality == 1) {
-               printstatsol(tcp, addr);
-               return;
-       }
-#endif /* LINUXSPARC */
-
        if (!addr) {
                tprintf("NULL");
                return;
@@ -1215,6 +1194,14 @@ printoldstat(struct tcb *tcp, long addr)
                tprintf("%#lx", addr);
                return;
        }
+
+#ifdef LINUXSPARC
+       if (current_personality == 1) {
+               printstatsol(tcp, addr);
+               return;
+       }
+#endif /* LINUXSPARC */
+
        if (umove(tcp, addr, &statbuf) < 0) {
                tprintf("{...}");
                return;