diff options
author | Arnaud Patard <arnaud.patard@rtp-net.org> | 2009-03-30 01:18:20 +0200 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2009-11-24 19:51:12 +0100 |
commit | 3ca055883b2a4b0099f1fcb34c5e72fc8e1fa05d (patch) | |
tree | c3b7403c283b3b4b614121dcf0b014f8d8cb5677 /linux-user | |
parent | tcg/ppc64,x86_64: fix constraints of op_qemu_st64 (diff) | |
download | qemu-kvm-3ca055883b2a4b0099f1fcb34c5e72fc8e1fa05d.tar.gz qemu-kvm-3ca055883b2a4b0099f1fcb34c5e72fc8e1fa05d.tar.bz2 qemu-kvm-3ca055883b2a4b0099f1fcb34c5e72fc8e1fa05d.zip |
linux-user: remove hardcoded value of _NSIG in signal.c
In a bunch of places, 64 is used as value of _NSIG but it's wrong
at least on MIPS were _NSIG is 128.
Based on a patch from Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/signal.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/linux-user/signal.c b/linux-user/signal.c index 2df17aa21..df189c3cb 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -44,7 +44,7 @@ static struct target_sigaction sigact_table[TARGET_NSIG]; static void host_signal_handler(int host_signum, siginfo_t *info, void *puc); -static uint8_t host_to_target_signal_table[65] = { +static uint8_t host_to_target_signal_table[_NSIG] = { [SIGHUP] = TARGET_SIGHUP, [SIGINT] = TARGET_SIGINT, [SIGQUIT] = TARGET_SIGQUIT, @@ -87,7 +87,7 @@ static uint8_t host_to_target_signal_table[65] = { [__SIGRTMIN] = __SIGRTMAX, [__SIGRTMAX] = __SIGRTMIN, }; -static uint8_t target_to_host_signal_table[65]; +static uint8_t target_to_host_signal_table[_NSIG]; static inline int on_sig_stack(unsigned long sp) { @@ -103,14 +103,14 @@ static inline int sas_ss_flags(unsigned long sp) int host_to_target_signal(int sig) { - if (sig > 64) + if (sig >= _NSIG) return sig; return host_to_target_signal_table[sig]; } int target_to_host_signal(int sig) { - if (sig > 64) + if (sig >= _NSIG) return sig; return target_to_host_signal_table[sig]; } @@ -311,11 +311,11 @@ void signal_init(void) int host_sig; /* generate signal conversion tables */ - for(i = 1; i <= 64; i++) { + for(i = 1; i < _NSIG; i++) { if (host_to_target_signal_table[i] == 0) host_to_target_signal_table[i] = i; } - for(i = 1; i <= 64; i++) { + for(i = 1; i < _NSIG; i++) { j = host_to_target_signal_table[i]; target_to_host_signal_table[j] = i; } |