浏览代码

BUG: Do not report an error removing the binary directory if it doesn't exist.

Brad King 20 年之前
父节点
当前提交
1ab9f4747d
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      Source/CTest/cmCTestScriptHandler.cxx

+ 4 - 4
Source/CTest/cmCTestScriptHandler.cxx

@@ -788,10 +788,10 @@ bool cmCTestScriptHandler::EmptyBinaryDirectory(const char *sname)
   // try to avoid deleting directories that we shouldn't
   // try to avoid deleting directories that we shouldn't
   std::string check = sname;
   std::string check = sname;
   check += "/CMakeCache.txt";
   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;
 }
 }