X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/597f6f31e3801612273886481381df509d8bcd12..25bc185367ffb0caf3197babf44243d1703895e3:/stglibs/pinger.lib/pinger.cpp?ds=sidebyside diff --git a/stglibs/pinger.lib/pinger.cpp b/stglibs/pinger.lib/pinger.cpp index 8e6370ed..664367e8 100644 --- a/stglibs/pinger.lib/pinger.cpp +++ b/stglibs/pinger.lib/pinger.cpp @@ -18,7 +18,7 @@ #include "stg/common.h" #include "stg/locker.h" -#include "pinger.h" +#include "stg/pinger.h" #ifdef STG_TIME extern volatile time_t stgTime; @@ -98,16 +98,6 @@ if (isRunningRecver) struct timespec ts = {0, 200000000}; nanosleep(&ts, NULL); } - - //after 5 seconds waiting thread still running. now killing it - if (isRunningRecver) - { - if (pthread_kill(recvThread, SIGINT)) - { - errorStr = "Cannot kill thread."; - return -1; - } - } } if (isRunningSender) @@ -121,19 +111,13 @@ if (isRunningSender) struct timespec ts = {0, 200000000}; nanosleep(&ts, NULL); } - - //after 5 seconds waiting thread still running. now killing it - if (isRunningSender) - { - if (pthread_kill(sendThread, SIGINT)) - { - errorStr = "Cannot kill thread."; - return -1; - } - } } close(sendSocket); + +if (isRunningSender || isRunningRecver) + return -1; + return 0; } //-----------------------------------------------------------------------------