浏览代码

uloop: properly initialize signal handler mask

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>
Jo-Philipp Wich 1 年之前
父节点
当前提交
f7d1569113
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      uloop.c

+ 1 - 0
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);
 	}