]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp
Replace deprecated usleep with POSIX-compliant nanosleep
[stg.git] / projects / stargazer / plugins / capture / ipq_linux / ipq_cap.cpp
index 7f60c7eb7123bc7578bd011de08eabc7d0e21d5f..84939b4e70e17e646bc8bf2a16025b64e8b45620 100644 (file)
@@ -95,7 +95,8 @@ for (int i = 0; i < 25; i++)
     {
     if (!isRunning)
         break;
-    usleep(200000);
+    struct timespec ts = {0, 200000000};
+    nanosleep(&ts, NULL);
     }
 //after 5 seconds waiting thread still running. now killing it
 if (isRunning)
@@ -107,7 +108,8 @@ if (isRunning)
         }
     for (int i = 0; i < 25 && isRunning; ++i)
         {
-        usleep(200000);
+        struct timespec ts = {0, 200000000};
+        nanosleep(&ts, NULL);
         }
     if (isRunning)
         {