summaryrefslogtreecommitdiff
path: root/lib/common
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-11-13 16:14:08 +0000
committerChris Wilson <chris+github@qwirx.com>2006-11-13 16:14:08 +0000
commit134622028a0b4a858d407eac9822f78a0bf01920 (patch)
tree2d571724e62968da500d079719d415713d8481d5 /lib/common
parentcc104c3057f6e282a09be6b15f8aa5e931a37363 (diff)
Fixed control reaching end of non-void functions (refs #3)
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++)
{