[Lldb-commits] [PATCH] Replace 'mkdir' shell invocation by native function call.

Jean-Daniel Dupas devlists at shadowlab.org
Fri Dec 6 16:04:13 PST 2013


  Restore the call to GetFile() that was missing in previous patch.

http://llvm-reviews.chandlerc.com/D2356

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D2356?vs=5969&id=5970#toc

Files:
  source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
  source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp

Index: source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
===================================================================
--- source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -273,14 +273,7 @@
 MakeCacheFolderForFile (const FileSpec& module_cache_spec)
 {
     FileSpec module_cache_folder = module_cache_spec.CopyByRemovingLastPathComponent();
-    StreamString mkdir_folder_cmd;
-    mkdir_folder_cmd.Printf("mkdir -p %s/%s", module_cache_folder.GetDirectory().AsCString(), module_cache_folder.GetFilename().AsCString());
-    return Host::RunShellCommand(mkdir_folder_cmd.GetData(),
-                          NULL,
-                          NULL,
-                          NULL,
-                          NULL,
-                          60);
+    return Host::MakeDirectory(module_cache_folder.GetPath().c_str(), 0700);
 }
 
 static lldb_private::Error
Index: source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
===================================================================
--- source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
+++ source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
@@ -288,16 +288,11 @@
             }
             // bring in the remote module file
             FileSpec module_cache_folder = module_cache_spec.CopyByRemovingLastPathComponent();
-            StreamString mkdir_folder_cmd;
             // try to make the local directory first
-            mkdir_folder_cmd.Printf("mkdir -p %s/%s", module_cache_folder.GetDirectory().AsCString(), module_cache_folder.GetFilename().AsCString());
-            Host::RunShellCommand(mkdir_folder_cmd.GetData(),
-                                  NULL,
-                                  NULL,
-                                  NULL,
-                                  NULL,
-                                  60);
-            Error err = GetFile(platform_file, module_cache_spec);
+            Error err = Host::MakeDirectory(module_cache_folder.GetPath().c_str(), 0700);
+            if (err.Fail())
+                return err;
+            err = GetFile(platform_file, module_cache_spec);
             if (err.Fail())
                 return err;
             if (module_cache_spec.Exists())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2356.2.patch
Type: text/x-patch
Size: 2235 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20131206/46ecf00b/attachment.bin>


More information about the lldb-commits mailing list