]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp
Replace deprecated usleep with POSIX-compliant nanosleep
[stg.git] / projects / stargazer / plugins / capture / cap_nf / cap_nf.cpp
index 9ed507561ddb75e575d3215e0143cc01c921b514..fb7d2cc5b0f291d4ffa846be6857008bb0e8499d 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)
         {