aboutsummaryrefslogtreecommitdiff
path: root/signal/sigaction.c
diff options
context:
space:
mode:
Diffstat (limited to 'signal/sigaction.c')
-rw-r--r--signal/sigaction.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/signal/sigaction.c b/signal/sigaction.c
index 811062a..c2931b8 100644
--- a/signal/sigaction.c
+++ b/signal/sigaction.c
@@ -16,8 +16,9 @@
<https://www.gnu.org/licenses/>. */
#include <errno.h>
-#include <signal.h>
#include <internal-signals.h>
+#include <libc-lock.h>
+#include <signal.h>
/* If ACT is not NULL, change the action for SIG to *ACT.
If OACT is not NULL, put the old action for SIG in *OACT. */
@@ -30,7 +31,17 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
return -1;
}
- return __libc_sigaction (sig, act, oact);
+ internal_sigset_t set;
+
+ if (sig == SIGABRT)
+ __abort_lock_lock (&set);
+
+ int r = __libc_sigaction (sig, act, oact);
+
+ if (sig == SIGABRT)
+ __abort_lock_unlock (&set);
+
+ return r;
}
libc_hidden_def (__sigaction)
weak_alias (__sigaction, sigaction)