summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2025-01-18 15:08:03 -0500
committerTavian Barnes <tavianator@tavianator.com>2025-01-18 15:10:06 -0500
commit9e16223877f624c900eb8804016afa5f3f13e385 (patch)
treebc7963a374fb4c7e5eb88d4ea865f76e5b1714aa /src
parentb32a43b3a825f1e5062e4d8fe78858f7f1d12f5e (diff)
downloadbfs-9e16223877f624c900eb8804016afa5f3f13e385.tar.xz
sighook: Don't forget to check `initialized` in sigreset()
Diffstat (limited to 'src')
-rw-r--r--src/sighook.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sighook.c b/src/sighook.c
index fc0db6d..1783b83 100644
--- a/src/sighook.c
+++ b/src/sighook.c
@@ -671,6 +671,10 @@ void sigunhook(struct sighook *hook) {
}
int sigreset(void) {
+ if (!load(&initialized, acquire)) {
+ return 0;
+ }
+
for_rcu (struct sigsave, save, &saved) {
if (sigaction(save->sig, &save->action, NULL) != 0) {
return -1;