]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp
Trailing coma removed
[stg.git] / projects / stargazer / plugins / capture / cap_nf / cap_nf.cpp
index 9ed507561ddb75e575d3215e0143cc01c921b514..51ba49546d26fb7a4d8c9ee3be18b9be1b9750ac 100644 (file)
@@ -148,7 +148,8 @@ if (portU && !stoppedUDP)
     CloseUDP();
     for (int i = 0; i < 25 && !stoppedUDP; ++i)
         {
-        usleep(200000);
+        struct timespec ts = {0, 200000000};
+        nanosleep(&ts, NULL);
         }
     if (stoppedUDP)
         {
@@ -170,7 +171,8 @@ if (portT && !stoppedTCP)
     CloseTCP();
     for (int i = 0; i < 25 && !stoppedTCP; ++i)
         {
-        usleep(200000);
+        struct timespec ts = {0, 200000000};
+        nanosleep(&ts, NULL);
         }
     if (stoppedTCP)
         {
@@ -242,6 +244,10 @@ return false;
 
 void * NF_CAP::RunUDP(void * c)
 {
+sigset_t signalSet;
+sigfillset(&signalSet);
+pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
+
 NF_CAP * cap = static_cast<NF_CAP *>(c);
 uint8_t buf[BUF_SIZE];
 int res;
@@ -284,6 +290,10 @@ return NULL;
 
 void * NF_CAP::RunTCP(void * c)
 {
+sigset_t signalSet;
+sigfillset(&signalSet);
+pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
+
 NF_CAP * cap = static_cast<NF_CAP *>(c);
 uint8_t buf[BUF_SIZE];
 int res;