From a9a258c3027b02121e989e98ab134f9f518938d2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 17 Jun 2020 15:13:47 -0400 Subject: 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 --- Source/cmCoreTryCompile.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 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); -- cgit v0.12