aboutsummaryrefslogtreecommitdiff
path: root/test/test_p2p.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_p2p.cpp')
-rw-r--r--test/test_p2p.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_p2p.cpp b/test/test_p2p.cpp
index d097562..aff712a 100644
--- a/test/test_p2p.cpp
+++ b/test/test_p2p.cpp
@@ -28,6 +28,7 @@
#include <functional>
#include <unordered_map>
#include <unistd.h>
+#include <signal.h>
#include "salticidae/msg.h"
#include "salticidae/event.h"
@@ -67,6 +68,13 @@ struct MsgText {
const uint8_t MsgText::opcode;
+void masksigs() {
+ sigset_t mask;
+ sigemptyset(&mask);
+ sigfillset(&mask);
+ pthread_sigmask(SIG_BLOCK, &mask, NULL);
+}
+
struct Net {
uint64_t id;
EventContext ec;
@@ -98,6 +106,7 @@ struct Net {
this->id, std::string(claimed_addr).c_str());
});
th = std::thread([=](){
+ masksigs();
try {
net->start();
net->listen(NetAddr(listen_addr));