[Lldb-commits] [PATCH] Use SHCreateDirectory to create new directory on Windows

Zachary Turner zturner at google.com
Fri Apr 10 09:56:54 PDT 2015


Looks good

On Fri, Apr 10, 2015 at 9:55 AM Oleksiy Vyalov <ovyalov at google.com> wrote:

> Switched to use lvm::sys::fs::create_directories instead of
> SHCreateDirectory.
> Please take another look.
>
>
> http://reviews.llvm.org/D8977
>
> Files:
>   source/Host/windows/FileSystem.cpp
>
> Index: source/Host/windows/FileSystem.cpp
> ===================================================================
> --- source/Host/windows/FileSystem.cpp
> +++ source/Host/windows/FileSystem.cpp
> @@ -12,6 +12,7 @@
>  #include <shellapi.h>
>
>  #include "lldb/Host/FileSystem.h"
> +#include "llvm/Support/FileSystem.h"
>
>  using namespace lldb_private;
>
> @@ -27,8 +28,12 @@
>      // On Win32, the mode parameter is ignored, as Windows files and
> directories support a
>      // different permission model than POSIX.
>      Error error;
> -    if (!::CreateDirectory(path, NULL) && GetLastError() !=
> ERROR_ALREADY_EXISTS)
> -        error.SetError(::GetLastError(), lldb::eErrorTypeWin32);
> +    const auto err_code = llvm::sys::fs::create_directories(path, true);
> +    if (err_code)
> +    {
> +        error.SetErrorString(err_code.message().c_str());
> +    }
> +
>      return error;
>  }
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150410/425b3581/attachment.html>


More information about the lldb-commits mailing list