From 1ab9f4747d2c306cdbc440fb506ba90bc6802250 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 11 Mar 2005 12:56:10 -0500 Subject: [PATCH] BUG: Do not report an error removing the binary directory if it doesn't exist. --- Source/CTest/cmCTestScriptHandler.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 5430619ec..5e15b5a52 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -788,10 +788,10 @@ bool cmCTestScriptHandler::EmptyBinaryDirectory(const char *sname) // try to avoid deleting directories that we shouldn't std::string check = sname; check += "/CMakeCache.txt"; - if (cmSystemTools::FileExists(check.c_str())) + if(cmSystemTools::FileExists(check.c_str()) && + !cmSystemTools::RemoveADirectory(sname)) { - cmSystemTools::RemoveADirectory(sname); - return true; + return false; } - return false; + return true; }