[llvm-commits] [PATCH 2/2] Fix warning on gcc 4.3.

Mikhail Glushenkov foldr at codedgers.com
Sat Feb 14 05:05:45 PST 2009


"system() declared with attribute warn_unused_result."
---
 lib/System/Unix/Path.inc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index 8efa2e0..a8dcedb 100644
--- a/lib/System/Unix/Path.inc
+++ b/lib/System/Unix/Path.inc
@@ -658,7 +658,10 @@ Path::eraseFromDisk(bool remove_contents, std::string *ErrStr) const {
   if (remove_contents) {
     // Recursively descend the directory to remove its contents.
     std::string cmd = "/bin/rm -rf " + path;
-    system(cmd.c_str());
+    if (system(cmd.c_str()) != 0) {
+      MakeErrMsg(ErrStr, path + ": failed to recursively remove directory.");
+      return true;
+    }
     return false;
   }
 
-- 
1.6.1.2




More information about the llvm-commits mailing list