From 1fa44a7ed981b36af3049dc99b5e8c2754bb51a0 Mon Sep 17 00:00:00 2001 From: Shai Levy <58184723+shailevi23@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:26:20 +0300 Subject: [PATCH 1/2] configure: improve pthread_sigmask detection. On Windows system, pthread_sigmask is defined as a noop which will trigger unused variable warning for sigmask. By triggering the same warning in the configure script, we make CONFIG_PTHREAD_SIGMASK undefined in the Windows msys2 build. Signed-off-by: Shai Levy . --- configure | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 36184a58ad..742cb7c533 100755 --- a/configure +++ b/configure @@ -864,7 +864,8 @@ cat > $TMPC < /* pthread_sigmask() */ int main(void) { - return pthread_sigmask(0, NULL, NULL); + sigset_t sigmask; + return pthread_sigmask(0, NULL, &sigmask); } EOF if compile_prog "" "$LIBS" "pthread_sigmask" ; then From 864742594519946b0bcf9f5f351676b01772b601 Mon Sep 17 00:00:00 2001 From: Shai Levy <58184723+shailevi23@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:29:04 +0300 Subject: [PATCH 2/2] helper_thread: fix pthread_sigmask typo. Signed-off-by: Shai Levy . --- helper_thread.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helper_thread.c b/helper_thread.c index 53dea44bab..2a9dabf5f7 100644 --- a/helper_thread.c +++ b/helper_thread.c @@ -106,13 +106,14 @@ static int read_from_pipe(int fd, void *buf, size_t len) static void block_signals(void) { -#ifdef HAVE_PTHREAD_SIGMASK +#ifdef CONFIG_PTHREAD_SIGMASK sigset_t sigmask; + int ret; + ret = pthread_sigmask(SIG_UNBLOCK, NULL, &sigmask); assert(ret == 0); ret = pthread_sigmask(SIG_BLOCK, &sigmask, NULL); - assert(ret == 0); #endif }