[llvm-commits] CVS: llvm/lib/System/Win32/Path.inc

Chris Lattner lattner at cs.uiuc.edu
Fri Jul 28 15:36:33 PDT 2006



Changes in directory llvm/lib/System/Win32:

Path.inc updated: 1.47 -> 1.48
---
Log message:

Modify setStatusInfoOnDisk to not throw an exception.


---
Diffs of the changes:  (+8 -8)

 Path.inc |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)


Index: llvm/lib/System/Win32/Path.inc
diff -u llvm/lib/System/Win32/Path.inc:1.47 llvm/lib/System/Win32/Path.inc:1.48
--- llvm/lib/System/Win32/Path.inc:1.47	Fri Jul 28 17:32:09 2006
+++ llvm/lib/System/Win32/Path.inc	Fri Jul 28 17:36:17 2006
@@ -693,9 +693,9 @@
 }
 
 bool
-Path::setStatusInfoOnDisk(const FileStatus &si) const {
+Path::setStatusInfoOnDisk(const FileStatus &si, std::string *ErrStr) const {
   // FIXME: should work on directories also.
-  if (!isFile()) return false;
+  if (!isFile()) return true;
 
   HANDLE h = CreateFile(path.c_str(),
                         FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES,
@@ -705,14 +705,14 @@
                         FILE_ATTRIBUTE_NORMAL,
                         NULL);
   if (h == INVALID_HANDLE_VALUE)
-    return false;
+    return true;
 
   BY_HANDLE_FILE_INFORMATION bhfi;
   if (!GetFileInformationByHandle(h, &bhfi)) {
     DWORD err = GetLastError();
     CloseHandle(h);
     SetLastError(err);
-    ThrowError(path + ": GetFileInformationByHandle: ");
+    return GetError(path + ": GetFileInformationByHandle: ", ErrStr);
   }
 
   FILETIME ft;
@@ -722,7 +722,7 @@
   CloseHandle(h);
   if (!ret) {
     SetLastError(err);
-    ThrowError(path + ": SetFileTime: ");
+    return GetError(path + ": SetFileTime: ", ErrStr);
   }
 
   // Best we can do with Unix permission bits is to interpret the owner
@@ -731,17 +731,17 @@
     if (bhfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY) {
       if (!SetFileAttributes(path.c_str(),
               bhfi.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY))
-        ThrowError(path + ": SetFileAttributes: ");
+        return GetError(path + ": SetFileAttributes: ", ErrStr);
     }
   } else {
     if (!(bhfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) {
       if (!SetFileAttributes(path.c_str(),
               bhfi.dwFileAttributes | FILE_ATTRIBUTE_READONLY))
-        ThrowError(path + ": SetFileAttributes: ");
+        return GetError(path + ": SetFileAttributes: ", ErrStr);
     }
   }
 
-  return true;
+  return false;
 }
 
 void






More information about the llvm-commits mailing list