public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] signal: Use <sigsetops.h> for sigemptyset, sigfillset
@ 2020-05-08 16:33 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2020-05-08 16:33 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9f6bd1f6057e57cce9b07844c28f15859ab15d49

commit 9f6bd1f6057e57cce9b07844c28f15859ab15d49
Author: Florian Weimer <fweimer@redhat.com>
Date:   Fri May 8 17:29:10 2020 +0200

    signal: Use <sigsetops.h> for sigemptyset, sigfillset
    
    This avoids changing the entire sigset_t structure.  Updating the
    actually used part is sufficient.

Diff:
---
 signal/sigempty.c   | 5 ++---
 signal/sigfillset.c | 6 ++----
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/signal/sigempty.c b/signal/sigempty.c
index 794e449997..31b1145027 100644
--- a/signal/sigempty.c
+++ b/signal/sigempty.c
@@ -17,7 +17,7 @@
 
 #include <errno.h>
 #include <signal.h>
-#include <string.h>
+#include <sigsetops.h>
 
 /* Clear all signals from SET.  */
 int
@@ -29,8 +29,7 @@ sigemptyset (sigset_t *set)
       return -1;
     }
 
-  memset (set, 0, sizeof (sigset_t));
-
+  __sigemptyset (set);
   return 0;
 }
 libc_hidden_def (sigemptyset)
diff --git a/signal/sigfillset.c b/signal/sigfillset.c
index 0ca8b6b534..29e98a5864 100644
--- a/signal/sigfillset.c
+++ b/signal/sigfillset.c
@@ -17,8 +17,8 @@
 
 #include <errno.h>
 #include <signal.h>
-#include <string.h>
 #include <internal-signals.h>
+#include <sigsetops.h>
 
 /* Set all signals in SET.  */
 int
@@ -30,10 +30,8 @@ sigfillset (sigset_t *set)
       return -1;
     }
 
-  memset (set, 0xff, sizeof (sigset_t));
-
+  __sigfillset (set);
   __clear_internal_signals (set);
-
   return 0;
 }
 libc_hidden_def (sigfillset)


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

only message in thread, other threads:[~2020-05-08 16:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 16:33 [glibc] signal: Use <sigsetops.h> for sigemptyset, sigfillset 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).