mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
KWSys 2025-11-12 (1139f8a0)
Code extracted from:
https://gitlab.kitware.com/utils/kwsys.git
at commit 1139f8a044044860e9a4c3b964750cbe68fe3f6d (master).
Upstream Shortlog
-----------------
Brad King (2):
abb5ca15 SystemTools: Fix CopyFileIfNewer error status when source is missing
001e388f Directory: Restore Load() error for missing directory on Windows
This commit is contained in:
committed by
Brad King
parent
fc7ef5028a
commit
dc8cc945ee
@@ -184,7 +184,7 @@ Status Directory::Load(std::string const& name, std::string* errorMessage)
|
||||
delete[] buf;
|
||||
|
||||
if (srchHandle == INVALID_HANDLE_VALUE) {
|
||||
Status status = Status::POSIX_errno();
|
||||
Status status = Status::Windows_GetLastError();
|
||||
if (errorMessage) {
|
||||
*errorMessage = status.GetString();
|
||||
}
|
||||
@@ -198,7 +198,7 @@ Status Directory::Load(std::string const& name, std::string* errorMessage)
|
||||
} while (FindNextFileW(srchHandle, &data));
|
||||
this->Internal->Path = name;
|
||||
if (!FindClose(srchHandle)) {
|
||||
Status status = Status::POSIX_errno();
|
||||
Status status = Status::Windows_GetLastError();
|
||||
if (errorMessage) {
|
||||
*errorMessage = status.GetString();
|
||||
}
|
||||
|
||||
@@ -2273,7 +2273,7 @@ SystemTools::CopyStatus SystemTools::CopyFileIfNewer(
|
||||
// source and destination are files so do a copy if source is newer
|
||||
// Check if source file exists first
|
||||
if (!SystemTools::FileExists(source)) {
|
||||
return CopyStatus{ Status::POSIX_errno(), CopyStatus::SourcePath };
|
||||
return CopyStatus{ Status::POSIX(ENOENT), CopyStatus::SourcePath };
|
||||
}
|
||||
// If destination doesn't exist, always copy
|
||||
if (!SystemTools::FileExists(destination)) {
|
||||
|
||||
Reference in New Issue
Block a user