From 4e718b5ea2014839c298dbd7b7cb0f1c15fae1aa Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 20 Apr 2009 18:30:13 +0000 Subject: [PATCH] * strace.c (printstatsol, printstat_sparc64): 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 | 8 +++++++ file.c | 71 +++++++++++++++++++++++-------------------------------- 2 files changed, 37 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b1fed5b..64bbe50d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-04-20 Denys Vlasenko + + * 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 * strace.c (collect_stopped_tcbs): Do not enable/disable signals diff --git a/file.c b/file.c index 080e10b0..53c24895 100644 --- 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; -- 2.40.0