about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--sysdeps/generic/internal-signals.h15
2 files changed, 20 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 663e80c195..43e0d6b95f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-04-04  Zack Weinberg  <zackw@panix.com>
+
+	* sysdeps/generic/internal-signals.h: Include signal.h,
+	sigsetops.h, and stdbool.h.
+	(__libc_signal_block_all): Actually block all signals.
+	(__libc_signal_block_app): Likewise.
+	(__libc_signal_restore_set): Actually restore the signal mask.
+
 2018-04-04  Florian Weimer  <fweimer@redhat.com>
 
 	inet: Actually build and run tst-deadline.
diff --git a/sysdeps/generic/internal-signals.h b/sysdeps/generic/internal-signals.h
index 17ed48c5bf..5282cffce0 100644
--- a/sysdeps/generic/internal-signals.h
+++ b/sysdeps/generic/internal-signals.h
@@ -19,6 +19,10 @@
 #ifndef __INTERNAL_SIGNALS_H
 # define __INTERNAL_SIGNALS_H
 
+#include <signal.h>
+#include <sigsetops.h>
+#include <stdbool.h>
+
 static inline bool
 __is_internal_signal (int sig)
 {
@@ -33,20 +37,25 @@ __clear_internal_signals (sigset_t *set)
 static inline int
 __libc_signal_block_all (sigset_t *set)
 {
-  return 0;
+  sigset_t allset;
+  __sigfillset (&allset);
+  return __sigprocmask (SIG_BLOCK, &allset, set);
 }
 
 static inline int
 __libc_signal_block_app (sigset_t *set)
 {
-  return 0;
+  sigset_t allset;
+  __sigfillset (&allset);
+  __clear_internal_signals (&allset);
+  return __sigprocmask (SIG_BLOCK, &allset, set);
 }
 
 /* Restore current process signal mask.  */
 static inline int
 __libc_signal_restore_set (const sigset_t *set)
 {
-  return 0;
+  return __sigprocmask (SIG_SETMASK, set, NULL);
 }