summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2009-04-20 18:30:13 +0000
committerRoland McGrath <roland@redhat.com>2009-06-02 16:45:31 -0700
commit06eb0ecf1dab5c6d4ed9f060f1f1ae2fd1a21238 (patch)
tree24b281c96bd2e439715725c59b48e6eb17ad287c
parent6c2f8e7f9b741251a327589665b1ea91b4433a05 (diff)
downloadstrace-06eb0ecf1dab5c6d4ed9f060f1f1ae2fd1a21238.tar.gz
* 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.
-rw-r--r--ChangeLog8
-rw-r--r--file.c71
2 files changed, 37 insertions, 42 deletions
diff --git a/ChangeLog b/ChangeLog
index 1e472a281..bdd42a85f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-20 Denys Vlasenko <dvlasenk@redhat.com>
+
+ * file.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-16 Denys Vlasenko <dvlasenk@redhat.com>
* file.c (print_dirfd): Use int for file descriptor, not a long.
diff --git a/file.c b/file.c
index 080e10b0c..53c248951 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;