diff mbox series

[v2,7/7] linux-user/nios2: Use set_sigmask in do_rt_sigreturn

Message ID 20211221025012.1057923-8-richard.henderson@linaro.org
State New
Headers show
Series linux-user: nios2 fixes | expand

Commit Message

Richard Henderson Dec. 21, 2021, 2:50 a.m. UTC
Using do_sigprocmask directly was incorrect, as it will
leave the signal blocked by the outer layers of linux-user.

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/nios2/signal.c | 2 +-
 linux-user/signal.c       | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

Comments

Laurent Vivier Jan. 5, 2022, 10:24 a.m. UTC | #1
Le 21/12/2021 à 03:50, Richard Henderson a écrit :
> Using do_sigprocmask directly was incorrect, as it will
> leave the signal blocked by the outer layers of linux-user.
> 
> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   linux-user/nios2/signal.c | 2 +-
>   linux-user/signal.c       | 2 --
>   2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c
> index 80e3d42fc9..517cd39270 100644
> --- a/linux-user/nios2/signal.c
> +++ b/linux-user/nios2/signal.c
> @@ -205,7 +205,7 @@ long do_rt_sigreturn(CPUNios2State *env)
>       }
>   
>       target_to_host_sigset(&set, &frame->uc.tuc_sigmask);
> -    do_sigprocmask(SIG_SETMASK, &set, NULL);
> +    set_sigmask(&set);
>   
>       if (rt_restore_ucontext(env, &frame->uc, &rval)) {
>           goto badframe;
> diff --git a/linux-user/signal.c b/linux-user/signal.c
> index 6d5e5b698c..8cb33a351c 100644
> --- a/linux-user/signal.c
> +++ b/linux-user/signal.c
> @@ -258,7 +258,6 @@ int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
>       return 0;
>   }
>   
> -#if !defined(TARGET_NIOS2)
>   /* Just set the guest's signal mask to the specified value; the
>    * caller is assumed to have called block_signals() already.
>    */
> @@ -268,7 +267,6 @@ void set_sigmask(const sigset_t *set)
>   
>       ts->signal_mask = *set;
>   }
> -#endif
>   
>   /* sigaltstack management */
>   


Applied to my linux-user-for-7.0 branch.

Thanks,
Laurent
diff mbox series

Patch

diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c
index 80e3d42fc9..517cd39270 100644
--- a/linux-user/nios2/signal.c
+++ b/linux-user/nios2/signal.c
@@ -205,7 +205,7 @@  long do_rt_sigreturn(CPUNios2State *env)
     }
 
     target_to_host_sigset(&set, &frame->uc.tuc_sigmask);
-    do_sigprocmask(SIG_SETMASK, &set, NULL);
+    set_sigmask(&set);
 
     if (rt_restore_ucontext(env, &frame->uc, &rval)) {
         goto badframe;
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 6d5e5b698c..8cb33a351c 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -258,7 +258,6 @@  int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
     return 0;
 }
 
-#if !defined(TARGET_NIOS2)
 /* Just set the guest's signal mask to the specified value; the
  * caller is assumed to have called block_signals() already.
  */
@@ -268,7 +267,6 @@  void set_sigmask(const sigset_t *set)
 
     ts->signal_mask = *set;
 }
-#endif
 
 /* sigaltstack management */