X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/02f215c550418f180d0d1b2694c99a7a8d4dc4b2..53c1823aaef2eb8d547a8eed8cfe12fe7204ca79:/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp?ds=sidebyside diff --git a/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp b/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp index d45b1755..276c8df0 100644 --- a/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp +++ b/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp @@ -72,7 +72,9 @@ return "Ether_cap v.1.2"; } //----------------------------------------------------------------------------- ETHER_CAP::ETHER_CAP() - : nonstop(false), + : errorStr(), + thread(), + nonstop(false), isRunning(false), capSock(-1), traffCnt(NULL) @@ -113,7 +115,8 @@ nonstop = false; //5 seconds to thread stops itself for (int i = 0; i < 25 && isRunning; i++) { - usleep(200000); + struct timespec ts = {0, 200000000}; + nanosleep(&ts, NULL); } //after 5 seconds waiting thread still running. now killing it if (isRunning) @@ -124,7 +127,10 @@ if (isRunning) return -1; } for (int i = 0; i < 25 && isRunning; ++i) - usleep(200000); + { + struct timespec ts = {0, 200000000}; + nanosleep(&ts, NULL); + } if (isRunning) { errorStr = "ETHER_CAP not stopped.";