mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -100,7 +100,7 @@ static file_t openFileInternal(const path& Path, std::error_code& EC,
|
||||
Disp, Flags, NULL);
|
||||
if (H == INVALID_HANDLE_VALUE) {
|
||||
DWORD LastError = ::GetLastError();
|
||||
EC = wpi::mapWindowsError(LastError);
|
||||
EC = wpi::util::mapWindowsError(LastError);
|
||||
// Provide a better error message when trying to open directories.
|
||||
// This only runs if we failed to open the file, so there is probably
|
||||
// no performances issues.
|
||||
@@ -121,7 +121,7 @@ static std::error_code setDeleteDisposition(HANDLE Handle, bool Delete) {
|
||||
Disposition.DeleteFile = Delete;
|
||||
if (!::SetFileInformationByHandle(Handle, FileDispositionInfo, &Disposition,
|
||||
sizeof(Disposition)))
|
||||
return wpi::mapWindowsError(::GetLastError());
|
||||
return wpi::util::mapWindowsError(::GetLastError());
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ file_t OpenFile(const path& Path, std::error_code& EC, CreationDisposition Disp,
|
||||
::SetFileTime(Result, NULL, &FileTime, NULL) == 0) {
|
||||
DWORD LastError = ::GetLastError();
|
||||
::CloseHandle(Result);
|
||||
EC = wpi::mapWindowsError(LastError);
|
||||
EC = wpi::util::mapWindowsError(LastError);
|
||||
return WPI_kInvalidFile;
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,7 @@ file_t OpenFileForRead(const path& Path, std::error_code& EC, OpenFlags Flags) {
|
||||
|
||||
int FileToFd(file_t& F, std::error_code& EC, OpenFlags Flags) {
|
||||
if (F == WPI_kInvalidFile) {
|
||||
EC = wpi::mapWindowsError(ERROR_INVALID_HANDLE);
|
||||
EC = wpi::util::mapWindowsError(ERROR_INVALID_HANDLE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ int FileToFd(file_t& F, std::error_code& EC, OpenFlags Flags) {
|
||||
int ResultFD = ::_open_osfhandle(intptr_t(F), CrtOpenFlags);
|
||||
if (ResultFD == -1) {
|
||||
::CloseHandle(F);
|
||||
EC = wpi::mapWindowsError(ERROR_INVALID_HANDLE);
|
||||
EC = wpi::util::mapWindowsError(ERROR_INVALID_HANDLE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ file_t OpenFile(const path& Path, std::error_code& EC, CreationDisposition Disp,
|
||||
// Call ::open in a lambda to avoid overload resolution in RetryAfterSignal
|
||||
// when open is overloaded, such as in Bionic.
|
||||
auto Open = [&]() { return ::open(Path.c_str(), OpenFlags, Mode); };
|
||||
if ((ResultFD = wpi::sys::RetryAfterSignal(-1, Open)) < 0) {
|
||||
if ((ResultFD = wpi::util::sys::RetryAfterSignal(-1, Open)) < 0) {
|
||||
EC = std::error_code(errno, std::generic_category());
|
||||
return WPI_kInvalidFile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user