]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp
Block all signals in threads other than main
[stg.git] / projects / stargazer / plugins / capture / divert_freebsd / divert_cap.cpp
index 5927727e516a221dcc716bf87f58ef8258beaa9f..9a9d154300ae231a960b12bc0a1c4b8e30961064 100644 (file)
@@ -150,7 +150,11 @@ return 0;
 //-----------------------------------------------------------------------------
 void * DIVERT_CAP::Run(void * d)
 {
-DIVERT_CAP * dc = (DIVERT_CAP *)d;
+sigset_t signalSet;
+sigfillset(&signalSet);
+pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
+
+DIVERT_CAP * dc = static_cast<DIVERT_CAP *>(d);
 dc->isRunning = true;
 
 char buffer[64];