]> granicus.if.org Git - strace/commitdiff
sparc64: fix decoding of struct stat64 related syscalls
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 22 Aug 2016 09:34:54 +0000 (09:34 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 22 Aug 2016 09:35:13 +0000 (09:35 +0000)
For some reason, struct stat and struct stat64 are different on sparc64.
This change fixes decoding of struct stat64 related syscalls for sparc64
personality, sparc32 personality on sparc64 needs more work.

* file.c (printstat64) [SPARC64]: Do not use printstat.
(SYS_FUNC(newfstatat)): Likewise.

file.c

diff --git a/file.c b/file.c
index 2ff0ac7d47754cac0a8c4c5d8a48237ec8729a0e..51e8e41d31d824ac0d84992be9d7572c9945986b 100644 (file)
--- a/file.c
+++ b/file.c
@@ -206,12 +206,12 @@ printstat64(struct tcb *tcp, long addr)
        (void) sizeof(char[sizeof statbuf == STAT64_SIZE ? 1 : -1]);
 # endif
 
-# ifdef STAT32_PERSONALITY
+# if defined STAT32_PERSONALITY && !defined SPARC64
        if (current_personality != STAT32_PERSONALITY) {
                printstat(tcp, addr);
                return;
        }
-# endif /* STAT32_PERSONALITY */
+# endif /* STAT32_PERSONALITY && !SPARC64 */
 
        if (!umove_or_printaddr(tcp, addr, &statbuf))
                do_printstat64(tcp, &statbuf);
@@ -260,7 +260,7 @@ SYS_FUNC(newfstatat)
                printpath(tcp, tcp->u_arg[1]);
                tprints(", ");
        } else {
-#if defined STAT32_PERSONALITY
+#if defined STAT32_PERSONALITY && !defined SPARC64
                if (current_personality == STAT32_PERSONALITY)
                        printstat64(tcp, tcp->u_arg[2]);
                else