]> sourceware.org Git - glibc.git/commitdiff
signal: Use <sigsetops.h> for sigemptyset, sigfillset
authorFlorian Weimer <fweimer@redhat.com>
Fri, 8 May 2020 15:29:10 +0000 (17:29 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 8 May 2020 15:29:10 +0000 (17:29 +0200)
This avoids changing the entire sigset_t structure.  Updating the
actually used part is sufficient.

signal/sigempty.c
signal/sigfillset.c

index 794e4499973574d9efe34f8ca0d4eeaabb0f2b75..31b11450271f400a5f84c97770f69f19c1599294 100644 (file)
@@ -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)
index 0ca8b6b534272c91ca491100edfafcc5716fa92e..29e98a586456118ddf1c825608d7ff3e568e63cb 100644 (file)
@@ -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)
This page took 0.042436 seconds and 5 git commands to generate.