diff mbox series

[8/9] linux-user/nios2: Use set_sigmask in do_rt_sigreturn

Message ID 20211001153347.1736014-11-richard.henderson@linaro.org
State Superseded
Headers show
Series nios2: Enable cross compile and fix signals | expand

Commit Message

Richard Henderson Oct. 1, 2021, 3:33 p.m. UTC
Using do_sigprocmask directly was incorrect, as it will
leave the signal blocked by the outer layers of linux-user.

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(-)

-- 
2.25.1

Comments

Laurent Vivier Oct. 12, 2021, 6:29 a.m. UTC | #1
Le 01/10/2021 à 17:33, Richard Henderson a écrit :
> Using do_sigprocmask directly was incorrect, as it will

> leave the signal blocked by the outer layers of linux-user.

> 

> 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 2038216455..5ec63cd092 100644

> --- a/linux-user/signal.c

> +++ b/linux-user/signal.c

> @@ -252,7 +252,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.

>   */

> @@ -262,7 +261,6 @@ void set_sigmask(const sigset_t *set)

>  

>      ts->signal_mask = *set;

>  }

> -#endif

>  

>  /* sigaltstack management */

>  

> 


Reviewed-by: Laurent Vivier <laurent@vivier.eu>
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 2038216455..5ec63cd092 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -252,7 +252,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.
  */
@@ -262,7 +261,6 @@  void set_sigmask(const sigset_t *set)
 
     ts->signal_mask = *set;
 }
-#endif
 
 /* sigaltstack management */