diff options
author | Andreas Färber <afaerber@suse.de> | 2011-12-29 16:55:43 +0100 |
---|---|---|
committer | Riku Voipio <riku.voipio@linaro.org> | 2012-02-02 17:51:21 +0200 |
commit | f78b0f05414f911d36afcd52f2330574d5a21952 (patch) | |
tree | b8230ae647c4a9d0326e0ff3028fff0119edb35c | |
parent | 2aeb36a897c6de08e9ede9e318d5970855b4b8f3 (diff) |
linux-user: Fix sa_flags byte swaps for mips
sa_flags is uint32_t for mips{,n32,64}, so don't use tswapal().
edited by Riku Voipio: likewise on alpha
Reported-by: Khansa Butt <khansa@kics.edu.pk>
Suggested-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Ehsan Ul Haq <ehsan.ulhaq@kics.edu.pk>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
-rw-r--r-- | linux-user/signal.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/linux-user/signal.c b/linux-user/signal.c index ded12caa18..79a39dcd7f 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -587,7 +587,11 @@ int do_sigaction(int sig, const struct target_sigaction *act, #endif if (oact) { oact->_sa_handler = tswapal(k->_sa_handler); +#if defined(TARGET_MIPS) || defined (TARGET_ALPHA) + oact->sa_flags = bswap32(k->sa_flags); +#else oact->sa_flags = tswapal(k->sa_flags); +#endif #if !defined(TARGET_MIPS) oact->sa_restorer = tswapal(k->sa_restorer); #endif @@ -596,7 +600,11 @@ int do_sigaction(int sig, const struct target_sigaction *act, if (act) { /* FIXME: This is not threadsafe. */ k->_sa_handler = tswapal(act->_sa_handler); +#if defined(TARGET_MIPS) || defined (TARGET_ALPHA) + k->sa_flags = bswap32(act->sa_flags); +#else k->sa_flags = tswapal(act->sa_flags); +#endif #if !defined(TARGET_MIPS) k->sa_restorer = tswapal(act->sa_restorer); #endif |