From 3f4ebba1fa8fc6fd26e71d4f3df2deec81cb15fb Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Sat, 24 May 2008 05:42:29 +0000 Subject: Create archives with the same permissions are ar. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Mikael Lepistö. llvm-svn: 51540 --- llvm/lib/Archive/ArchiveWriter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/Archive/ArchiveWriter.cpp') diff --git a/llvm/lib/Archive/ArchiveWriter.cpp b/llvm/lib/Archive/ArchiveWriter.cpp index c5d54fb..2269464 100644 --- a/llvm/lib/Archive/ArchiveWriter.cpp +++ b/llvm/lib/Archive/ArchiveWriter.cpp @@ -467,5 +467,12 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress, if (TmpArchive.renamePathOnDisk(archPath, ErrMsg)) return true; + // Set correct read and write permissions after temporary file is moved + // to final destination path. + if (archPath.makeReadableOnDisk(ErrMsg)) + return true; + if (archPath.makeWriteableOnDisk(ErrMsg)) + return true; + return false; } -- cgit v1.1