about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--signal/sighold.c10
2 files changed, 4 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 9861b97e8f..8355074f7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2017-11-06  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+	* signal/sighold.c (sighold): Optimize implementation.
+
 	* sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Asssume
 	__NR_rt_sigqueueinfo.
 
diff --git a/signal/sighold.c b/signal/sighold.c
index 2e32e4718a..955ac5b0fb 100644
--- a/signal/sighold.c
+++ b/signal/sighold.c
@@ -26,14 +26,8 @@ sighold (int sig)
 {
   sigset_t set;
 
-  /* Retrieve current signal set.  */
-  if (__sigprocmask (SIG_SETMASK, NULL, &set) < 0)
-    return -1;
-
-  /* Add the specified signal.  */
+  sigemptyset (&set);
   if (sigaddset (&set, sig) < 0)
     return -1;
-
-  /* Set the new mask.  */
-  return __sigprocmask (SIG_SETMASK, &set, NULL);
+  return __sigprocmask (SIG_BLOCK, &set, NULL);
 }