forked from OSchip/llvm-project
Use llvm::sys::fs::create_directories to create new directory on Windows.
http://reviews.llvm.org/D8977 llvm-svn: 234610
This commit is contained in:
parent
a625f7bcf4
commit
cc81556831
|
@ -12,6 +12,7 @@
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
|
|
||||||
#include "lldb/Host/FileSystem.h"
|
#include "lldb/Host/FileSystem.h"
|
||||||
|
#include "llvm/Support/FileSystem.h"
|
||||||
|
|
||||||
using namespace lldb_private;
|
using namespace lldb_private;
|
||||||
|
|
||||||
|
@ -27,8 +28,12 @@ FileSystem::MakeDirectory(const char *path, uint32_t file_permissions)
|
||||||
// On Win32, the mode parameter is ignored, as Windows files and directories support a
|
// On Win32, the mode parameter is ignored, as Windows files and directories support a
|
||||||
// different permission model than POSIX.
|
// different permission model than POSIX.
|
||||||
Error error;
|
Error error;
|
||||||
if (!::CreateDirectory(path, NULL) && GetLastError() != ERROR_ALREADY_EXISTS)
|
const auto err_code = llvm::sys::fs::create_directories(path, true);
|
||||||
error.SetError(::GetLastError(), lldb::eErrorTypeWin32);
|
if (err_code)
|
||||||
|
{
|
||||||
|
error.SetErrorString(err_code.message().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue