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

Reid Spencer reid at x10sys.com
Tue Aug 22 23:56:45 PDT 2006



Changes in directory llvm/lib/System/Unix:

Path.inc updated: 1.55 -> 1.56
---
Log message:

For PR797: http://llvm.org/PR797 :
Remove exception throwing from Path::getDirectoryContents and its users.


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

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


Index: llvm/lib/System/Unix/Path.inc
diff -u llvm/lib/System/Unix/Path.inc:1.55 llvm/lib/System/Unix/Path.inc:1.56
--- llvm/lib/System/Unix/Path.inc:1.55	Tue Aug 22 19:39:35 2006
+++ llvm/lib/System/Unix/Path.inc	Wed Aug 23 01:56:27 2006
@@ -415,10 +415,12 @@
 }
 
 bool
-Path::getDirectoryContents(std::set<Path>& result) const {
+Path::getDirectoryContents(std::set<Path>& result, std::string* ErrMsg) const {
   DIR* direntries = ::opendir(path.c_str());
-  if (direntries == 0)
-    ThrowErrno(path + ": can't open directory");
+  if (direntries == 0) {
+    MakeErrMsg(ErrMsg, path + ": can't open directory");
+    return true;
+  }
 
   std::string dirPath = path;
   if (!lastIsSlash(dirPath))
@@ -433,14 +435,15 @@
       if (0 != lstat(aPath.path.c_str(), &st)) {
         if (S_ISLNK(st.st_mode))
           continue; // dangling symlink -- ignore
-        ThrowErrno(aPath.path +  ": can't determine file object type");
+        MakeErrMsg(ErrMsg, aPath.path +  ": can't determine file object type");
+        return true;
       }
       result.insert(aPath);
     }
   }
   
   closedir(direntries);
-  return true;
+  return false;
 }
 
 bool






More information about the llvm-commits mailing list