summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-17 19:13:47 (GMT)
committerBrad King <brad.king@kitware.com>2020-06-17 19:15:02 (GMT)
commita9a258c3027b02121e989e98ab134f9f518938d2 (patch)
treebe3b3022c3b8f5651c8240a4f293ee4d491a4204
parente66fe75792a2fbe9f3ffe237c748008906ae7116 (diff)
downloadCMake-a9a258c3027b02121e989e98ab134f9f518938d2.zip
CMake-a9a258c3027b02121e989e98ab134f9f518938d2.tar.gz
CMake-a9a258c3027b02121e989e98ab134f9f518938d2.tar.bz2
try_compile: Do not try to remove '.nfs*' files
These files are part of the NFS implementation and should not be removed. They will automatically disappear when NFS is done with them. Fixes: #20844
-rw-r--r--Source/cmCoreTryCompile.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index a7acadc..8550d04 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -1050,7 +1050,9 @@ void cmCoreTryCompile::CleanupFiles(std::string const& binDir)
std::set<std::string> deletedFiles;
for (unsigned long i = 0; i < dir.GetNumberOfFiles(); ++i) {
const char* fileName = dir.GetFile(i);
- if (strcmp(fileName, ".") != 0 && strcmp(fileName, "..") != 0) {
+ if (strcmp(fileName, ".") != 0 && strcmp(fileName, "..") != 0 &&
+ // Do not delete NFS temporary files.
+ !cmHasPrefix(fileName, ".nfs")) {
if (deletedFiles.insert(fileName).second) {
std::string const fullPath =
std::string(binDir).append("/").append(fileName);