[Box Backup-commit] COMMIT r1163 - box/chris/merge/lib/common
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Mon Nov 13 16:14:08 GMT 2006
Author: chris
Date: 2006-11-13 16:14:08 +0000 (Mon, 13 Nov 2006)
New Revision: 1163
Modified:
box/chris/merge/lib/common/Test.h
Log:
Fixed control reaching end of non-void functions (refs #3)
Modified: box/chris/merge/lib/common/Test.h
===================================================================
--- box/chris/merge/lib/common/Test.h 2006-11-13 16:13:20 UTC (rev 1162)
+++ box/chris/merge/lib/common/Test.h 2006-11-13 16:14:08 UTC (rev 1163)
@@ -239,7 +239,9 @@
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 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++)
{
More information about the Boxbackup-commit
mailing list