]> git.stg.codes - stg.git/blobdiff - stglibs/pinger.lib/pinger.cpp
Merge branch 'master' into full-month-stats
[stg.git] / stglibs / pinger.lib / pinger.cpp
index 8e6370ed4774c257bb9aea21cc78208025bedfbd..664367e897e6c0d7fc084d9efabd59f32ef14171 100644 (file)
@@ -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;
 }
 //-----------------------------------------------------------------------------