From 6b9396c07054f0fbeec730d662ca76d111a2a46c Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Thu, 6 Aug 2015 21:04:55 +0000 Subject: Thread premissions through sys::fs::create_director{y|ies} llvm-svn: 244268 --- llvm/lib/Support/Unix/Path.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Support/Unix/Path.inc') diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index 973d010..a77efcc 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -219,11 +219,12 @@ std::error_code current_path(SmallVectorImpl &result) { return std::error_code(); } -std::error_code create_directory(const Twine &path, bool IgnoreExisting) { +std::error_code create_directory(const Twine &path, bool IgnoreExisting, + perms Perms) { SmallString<128> path_storage; StringRef p = path.toNullTerminatedStringRef(path_storage); - if (::mkdir(p.begin(), S_IRWXU | S_IRWXG) == -1) { + if (::mkdir(p.begin(), Perms) == -1) { if (errno != EEXIST || !IgnoreExisting) return std::error_code(errno, std::generic_category()); } -- cgit v1.1