From: Miloš Stojanović <milos.stojano...@rt-rk.com> Fix copying between the host and target signal sets for the case when the target set is larger than the host set.
sigismember() returns 1 if the specified signal number is a member of the specified signal set, but it can also return -1 if an error occurs (e.g. an out of range signal number is specified). All non-zero values would cause the signal to be added, so a comparison with 1 is added to assure that only the signals which are really in the set get added to the other set. Signed-off-by: Miloš Stojanović <milos.stojano...@rt-rk.com> Signed-off-by: Aleksandar Markovic <amarko...@wavecomp.com> --- linux-user/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 44b2d3b..c08a7fe 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -116,7 +116,7 @@ void host_to_target_sigset_internal(target_sigset_t *d, int i; target_sigemptyset(d); for (i = 1; i <= TARGET_NSIG; i++) { - if (sigismember(s, i)) { + if (sigismember(s, i) == 1) { target_sigaddset(d, host_to_target_signal(i)); } } -- 2.7.4