uloop: properly initialize signal handler mask
authorJo-Philipp Wich <jo@mein.io>
Fri, 3 Nov 2023 21:24:04 +0000 (22:24 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 3 Nov 2023 21:27:57 +0000 (22:27 +0100)
The structure passed to `sigaction()` left it's `sa_mask` member uninitialized.

Fixes: beb356b ("uloop: add support for user defined signal handlers")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
uloop.c

diff --git a/uloop.c b/uloop.c
index 89a7029c9baacf341df15739bf0fbfc09b08c554..63428db041d7caa7674565017bb99a8928636815 100644 (file)
--- a/uloop.c
+++ b/uloop.c
@@ -568,6 +568,7 @@ int uloop_signal_add(struct uloop_signal *s)
        if (s->orig.sa_handler != uloop_signal_wake) {
                sa.sa_handler = uloop_signal_wake;
                sa.sa_flags = 0;
+               sigemptyset(&sa.sa_mask);
                sigaction(s->signo, &sa, NULL);
        }