summaryrefslogtreecommitdiff
path: root/lib/common
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common')
-rw-r--r--lib/common/Test.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/common/Test.h b/lib/common/Test.h
index 1312241d..3c7b00fd 100644
--- a/lib/common/Test.h
+++ b/lib/common/Test.h
@@ -239,7 +239,9 @@ inline bool HUPServer(int pid)
inline bool KillServerInternal(int pid)
{
- TEST_THAT(SendCommands("terminate"));
+ bool sent = SendCommands("terminate");
+ TEST_THAT(sent);
+ return sent;
}
#else // !WIN32
@@ -259,14 +261,19 @@ inline bool HUPServer(int pid)
inline bool KillServerInternal(int pid)
{
if(pid == 0 || pid == -1) return false;
- TEST_THAT(::kill(pid, SIGTERM) != -1);
+ bool killed = (::kill(pid, SIGTERM) == 0);
+ TEST_THAT(killed);
+ return killed;
}
#endif // WIN32
inline bool KillServer(int pid)
{
- KillServerInternal(pid);
+ if (!KillServerInternal(pid))
+ {
+ return false;
+ }
for (int i = 0; i < 30; i++)
{