public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] nptl: Remove uses of assert_perror
@ 2022-08-03  9:45 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2022-08-03  9:45 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=68e036f27f31c3378201702e182246504fb00f87

commit 68e036f27f31c3378201702e182246504fb00f87
Author: Florian Weimer <fweimer@redhat.com>
Date:   Wed Aug 3 11:41:53 2022 +0200

    nptl: Remove uses of assert_perror
    
    __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.
    
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Diff:
---
 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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-03  9:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03  9:45 [glibc] nptl: Remove uses of assert_perror Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).