Merge branch 'upstream-KWSys' into cmake-E-copy-system-errors

# By KWSys Upstream
* upstream-KWSys:
  KWSys 2025-11-12 (1139f8a0)
This commit is contained in:
Brad King
2025-11-12 11:53:21 -05:00
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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();
}
+1 -1
View File
@@ -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)) {