diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-08-25 21:37:17 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-08-25 21:37:17 +0000 |
commit | 05545755676b9ff35d244e55d749a15e28bb228b (patch) | |
tree | 1319237959c931cf8fe384f7b4ca1277bf32e938 /lib/System/Win32/Path.inc | |
parent | dcea1400738e85a5cddbf91093983c593c323a19 (diff) | |
download | external_llvm-05545755676b9ff35d244e55d749a15e28bb228b.tar.gz external_llvm-05545755676b9ff35d244e55d749a15e28bb228b.tar.bz2 external_llvm-05545755676b9ff35d244e55d749a15e28bb228b.zip |
For PR797:
Make the Win32 code exception free (untested/uncompiled) which forced some
interface changes which had ripple effect. This should be the last of 797.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29884 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32/Path.inc')
-rw-r--r-- | lib/System/Win32/Path.inc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc index c13cb3bd94..96a59ded6f 100644 --- a/lib/System/Win32/Path.inc +++ b/lib/System/Win32/Path.inc @@ -292,8 +292,8 @@ bool Path::getFileStatus(FileStatus &info, std::string *ErrStr) const { WIN32_FILE_ATTRIBUTE_DATA fi; if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi)) - return GetError("getStatusInfo():" + std::string(path) + - ": Can't get status: ", ErrStr); + return MakeErrMsg(ErrStr, "getStatusInfo():" + std::string(path) + + ": Can't get status: "); info.fileSize = fi.nFileSizeHigh; info.fileSize <<= sizeof(fi.nFileSizeHigh)*8; @@ -547,7 +547,7 @@ Path::eraseFromDisk(bool remove_contents, std::string *ErrStr) const { // attribute first. if (attr & FILE_ATTRIBUTE_READONLY) { if (!SetFileAttributes(path.c_str(), attr & ~FILE_ATTRIBUTE_READONLY)) - return GetError(path + ": Can't destroy file: ", ErrStr); + return MakeErrMsg(ErrStr, path + ": Can't destroy file: "); } if (!DeleteFile(path.c_str())) @@ -593,7 +593,7 @@ Path::eraseFromDisk(bool remove_contents, std::string *ErrStr) const { FindClose(h); if (err != ERROR_NO_MORE_FILES) { SetLastError(err); - return GetError(path + ": Can't read directory: ", ErrStr); + return MakeErrMsg(ErrStr, path + ": Can't read directory: "); } for (std::vector<Path>::iterator I = list.begin(); I != list.end(); @@ -603,14 +603,14 @@ Path::eraseFromDisk(bool remove_contents, std::string *ErrStr) const { } } else { if (GetLastError() != ERROR_FILE_NOT_FOUND) - return GetError(path + ": Can't read directory: ", ErrStr); + return MakeErrMsg(ErrStr, path + ": Can't read directory: "); } } pathname[lastchar] = 0; if (!RemoveDirectory(pathname)) - return GetError(std::string(pathname) + ": Can't destroy directory: ", - ErrStr); + return MakeErrMsg(ErrStr, + std::string(pathname) + ": Can't destroy directory: "); return false; } // It appears the path doesn't exist. @@ -671,7 +671,7 @@ Path::setStatusInfoOnDisk(const FileStatus &si, std::string *ErrStr) const { DWORD err = GetLastError(); CloseHandle(h); SetLastError(err); - return GetError(path + ": GetFileInformationByHandle: ", ErrStr); + return MakeErrMsg(ErrStr, path + ": GetFileInformationByHandle: "); } FILETIME ft; @@ -681,7 +681,7 @@ Path::setStatusInfoOnDisk(const FileStatus &si, std::string *ErrStr) const { CloseHandle(h); if (!ret) { SetLastError(err); - return GetError(path + ": SetFileTime: ", ErrStr); + return MakeErrMsg(path + ": SetFileTime: "); } // Best we can do with Unix permission bits is to interpret the owner @@ -690,13 +690,13 @@ Path::setStatusInfoOnDisk(const FileStatus &si, std::string *ErrStr) const { if (bhfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { if (!SetFileAttributes(path.c_str(), bhfi.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY)) - return GetError(path + ": SetFileAttributes: ", ErrStr); + return MakeErrMsg(ErrStr, path + ": SetFileAttributes: "); } } else { if (!(bhfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) { if (!SetFileAttributes(path.c_str(), bhfi.dwFileAttributes | FILE_ATTRIBUTE_READONLY)) - return GetError(path + ": SetFileAttributes: ", ErrStr); + return MakeErrMsg(ErrStr, path + ": SetFileAttributes: "); } } |