1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-16 22:37:30 +08:00

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
This commit is contained in:
Brad King
2020-06-17 15:13:47 -04:00
parent e66fe75792
commit a9a258c302

View File

@@ -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);