From 938fa9a1e289409ccb1212bff63a2194a723c307 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 24 Sep 2015 23:57:06 +0900 Subject: [PATCH] nghttpx: Fix compile error with --disable-threads --- src/shrpx_signal.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/shrpx_signal.cc b/src/shrpx_signal.cc index f689d4fa..e97d90b6 100644 --- a/src/shrpx_signal.cc +++ b/src/shrpx_signal.cc @@ -34,11 +34,12 @@ namespace shrpx { int shrpx_signal_block_all(sigset_t *oldset) { sigset_t newset; - int rv; sigfillset(&newset); #ifndef NOTHREADS + int rv; + rv = pthread_sigmask(SIG_SETMASK, &newset, oldset); if (rv != 0) { @@ -48,17 +49,18 @@ int shrpx_signal_block_all(sigset_t *oldset) { return 0; #else // NOTHREADS - return sigprocmask(SIG_SETMASK, &newset, &oldset); + return sigprocmask(SIG_SETMASK, &newset, oldset); #endif // NOTHREADS } int shrpx_signal_unblock_all() { sigset_t newset; - int rv; sigemptyset(&newset); #ifndef NOTHREADS + int rv; + rv = pthread_sigmask(SIG_SETMASK, &newset, nullptr); if (rv != 0) { @@ -73,9 +75,9 @@ int shrpx_signal_unblock_all() { } int shrpx_signal_set(sigset_t *set) { +#ifndef NOTHREADS int rv; -#ifndef NOTHREADS rv = pthread_sigmask(SIG_SETMASK, set, nullptr); if (rv != 0) {