diff mbox series

[2/3] nptl: Remove uses of assert_perror

Message ID 2d9e7fb75a80c85c50d6cbc227af2bde281c4fc6.1659350650.git.fweimer@redhat.com
State New
Headers show
Series Internal asserts cleanups | expand

Commit Message

Florian Weimer Aug. 1, 2022, 10:45 a.m. UTC
__pthread_sigmask cannot actually fail with valid pointer arguments
(it would need a really broken seccomp filter), and we do not check
for errors elsewhere.
---
 sysdeps/nptl/gai_misc.h | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Comments

Adhemerval Zanella Netto Aug. 1, 2022, 8:01 p.m. UTC | #1
On 01/08/22 07:45, Florian Weimer via Libc-alpha wrote:
> __pthread_sigmask cannot actually fail with valid pointer arguments
> (it would need a really broken seccomp filter), and we do not check
> for errors elsewhere.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/nptl/gai_misc.h | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/sysdeps/nptl/gai_misc.h b/sysdeps/nptl/gai_misc.h
> index c09350c2ed..4196eac6e6 100644
> --- a/sysdeps/nptl/gai_misc.h
> +++ b/sysdeps/nptl/gai_misc.h
> @@ -81,9 +81,7 @@ __gai_start_notify_thread (void)
>  {
>    sigset_t ss;
>    sigemptyset (&ss);
> -  int sigerr __attribute__ ((unused));
> -  sigerr = __pthread_sigmask (SIG_SETMASK, &ss, NULL);
> -  assert_perror (sigerr);
> +  (void) __pthread_sigmask (SIG_SETMASK, &ss, NULL);
>  }
>  
>  extern inline int
> @@ -106,15 +104,12 @@ __gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
>    sigset_t ss;
>    sigset_t oss;
>    sigfillset (&ss);
> -  int sigerr __attribute__ ((unused));
> -  sigerr = __pthread_sigmask (SIG_SETMASK, &ss, &oss);
> -  assert_perror (sigerr);
> +  (void) __pthread_sigmask (SIG_SETMASK, &ss, &oss);
>  
>    int ret = __pthread_create (threadp, &attr, tf, arg);
>  
>    /* Restore the signal mask.  */
> -  sigerr = __pthread_sigmask (SIG_SETMASK, &oss, NULL);
> -  assert_perror (sigerr);
> +  (void) __pthread_sigmask (SIG_SETMASK, &oss, NULL);
>  
>    (void) __pthread_attr_destroy (&attr);
>    return ret;
diff mbox series

Patch

diff --git a/sysdeps/nptl/gai_misc.h b/sysdeps/nptl/gai_misc.h
index c09350c2ed..4196eac6e6 100644
--- a/sysdeps/nptl/gai_misc.h
+++ b/sysdeps/nptl/gai_misc.h
@@ -81,9 +81,7 @@  __gai_start_notify_thread (void)
 {
   sigset_t ss;
   sigemptyset (&ss);
-  int sigerr __attribute__ ((unused));
-  sigerr = __pthread_sigmask (SIG_SETMASK, &ss, NULL);
-  assert_perror (sigerr);
+  (void) __pthread_sigmask (SIG_SETMASK, &ss, NULL);
 }
 
 extern inline int
@@ -106,15 +104,12 @@  __gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
   sigset_t ss;
   sigset_t oss;
   sigfillset (&ss);
-  int sigerr __attribute__ ((unused));
-  sigerr = __pthread_sigmask (SIG_SETMASK, &ss, &oss);
-  assert_perror (sigerr);
+  (void) __pthread_sigmask (SIG_SETMASK, &ss, &oss);
 
   int ret = __pthread_create (threadp, &attr, tf, arg);
 
   /* Restore the signal mask.  */
-  sigerr = __pthread_sigmask (SIG_SETMASK, &oss, NULL);
-  assert_perror (sigerr);
+  (void) __pthread_sigmask (SIG_SETMASK, &oss, NULL);
 
   (void) __pthread_attr_destroy (&attr);
   return ret;