summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaulo <paul@bayleaf.org.uk>2009-12-18 17:37:46 +0000
committerpaulo <paul@bayleaf.org.uk>2009-12-18 17:37:46 +0000
commit152acaa5615afcb6d5a06aaed74d2fdd4b5a1233 (patch)
tree981d9e869b6b706d120f2a8343c0e7b638d02dfd
parentfb6cada4cc787adc08740e4fdd71cd62b67e59db (diff)
downloadquagga-152acaa5615afcb6d5a06aaed74d2fdd4b5a1233.tar.bz2
quagga-152acaa5615afcb6d5a06aaed74d2fdd4b5a1233.tar.xz
Fix bug in using new mqueue interface. Change which signals
are blocked for non-main thraeds
-rw-r--r--lib/command_queue.c2
-rw-r--r--lib/qpnexus.c9
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/command_queue.c b/lib/command_queue.c
index 81ccebe5..69c8eca6 100644
--- a/lib/command_queue.c
+++ b/lib/command_queue.c
@@ -66,7 +66,7 @@ cq_action(mqueue_block mqb, mqb_flag_t flag)
{
int result;
int i;
- struct marshal *wyatt = mqb;
+ struct marshal *wyatt = mqb->arg0;
if (flag == mqb_action)
{
diff --git a/lib/qpnexus.c b/lib/qpnexus.c
index a12a760b..d8a8bbc6 100644
--- a/lib/qpnexus.c
+++ b/lib/qpnexus.c
@@ -200,11 +200,18 @@ qpn_start_bgp(void* arg)
* Not main thread. Block most signals, but be careful not to
* defer SIGTRAP because doing so breaks gdb, at least on
* NetBSD 2.0. Avoid asking to block SIGKILL, just because
- * we shouldn't be able to do so.
+ * we shouldn't be able to do so. Avoid blocking SIGFPE,
+ * SIGILL, SIGSEGV, SIGBUS as this is undefined by POSIX.
+ * Don't block SIGPIPE so that is gets ignored on this thread.
*/
sigfillset (&newmask);
sigdelset (&newmask, SIGTRAP);
sigdelset (&newmask, SIGKILL);
+ sigdelset (&newmask, SIGPIPE);
+ sigdelset (&newmask, SIGFPE);
+ sigdelset (&newmask, SIGILL);
+ sigdelset (&newmask, SIGSEGV);
+ sigdelset (&newmask, SIGBUS);
qpt_thread_sigmask(SIG_BLOCK, &newmask, NULL);
qpn->mts = mqueue_thread_signal_init(qpn->mts, qpn->thread_id, SIGMQUEUE);