diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2025-01-18 15:08:03 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2025-01-18 15:10:06 -0500 |
commit | 9e16223877f624c900eb8804016afa5f3f13e385 (patch) | |
tree | bc7963a374fb4c7e5eb88d4ea865f76e5b1714aa | |
parent | b32a43b3a825f1e5062e4d8fe78858f7f1d12f5e (diff) | |
download | bfs-9e16223877f624c900eb8804016afa5f3f13e385.tar.xz |
sighook: Don't forget to check `initialized` in sigreset()
-rw-r--r-- | src/sighook.c | 4 |
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; |