[Lldb-commits] [PATCH] Replace 'mkdir' shell invocation by native function call.
Greg Clayton
gclayton at apple.com
Mon Dec 9 10:45:02 PST 2013
I would suggest using the eFilePermissionsDirectoryDefault from lldb-enumerations instead of a hard coded 0700 constant. Once that is fixed, feel free to commit this.
On Dec 6, 2013, at 4:04 PM, Jean-Daniel Dupas <devlists at shadowlab.org> wrote:
> 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())
> <D2356.2.patch>_______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
More information about the lldb-commits
mailing list