public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Florian Weimer <fw@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] signal: Use <sigsetops.h> for sigemptyset, sigfillset
Date: Fri,  8 May 2020 16:33:08 +0000 (GMT)	[thread overview]
Message-ID: <20200508163308.B6F583858D34@sourceware.org> (raw)

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)


                 reply	other threads:[~2020-05-08 16:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200508163308.B6F583858D34@sourceware.org \
    --to=fw@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).