From 134622028a0b4a858d407eac9822f78a0bf01920 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 13 Nov 2006 16:14:08 +0000 Subject: Fixed control reaching end of non-void functions (refs #3) --- lib/common/Test.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/common') 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++) { -- cgit v1.2.3