]> granicus.if.org Git - strace/commitdiff
signal: limit scope of struct old_sigaction32 definition
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 28 May 2017 17:13:29 +0000 (17:13 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 28 May 2017 17:13:29 +0000 (17:13 +0000)
* signal.c (struct old_sigaction32): Define only if [!current_wordsize].

signal.c

index 5f6650f2de6eefe9122b5e41e395a4b2791c3ab0..40e8accf2704f9e318054833e0aa6cf9c35cb8ae 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -320,14 +320,6 @@ struct old_sigaction {
 #endif
 ;
 
-struct old_sigaction32 {
-       /* sa_handler may be a libc #define, need to use other name: */
-       uint32_t sa_handler__;
-       uint32_t sa_mask;
-       uint32_t sa_flags;
-       uint32_t sa_restorer;
-};
-
 static void
 decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr)
 {
@@ -335,7 +327,12 @@ decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr)
 
 #ifndef current_wordsize
        if (current_wordsize < sizeof(sa.sa_handler__)) {
-               struct old_sigaction32 sa32;
+               struct old_sigaction32 {
+                       uint32_t sa_handler__;
+                       uint32_t sa_mask;
+                       uint32_t sa_flags;
+                       uint32_t sa_restorer;
+               } sa32;
 
                if (umove_or_printaddr(tcp, addr, &sa32))
                        return;