summaryrefslogtreecommitdiff
path: root/lib/Archive
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-05-24 05:42:29 +0000
committerOwen Anderson <resistor@mac.com>2008-05-24 05:42:29 +0000
commita5464f3659a721328da98f7096390ac32f9ec6ed (patch)
tree454742059728c5bbf7cbc1a0566a236a220b9df8 /lib/Archive
parentcad93bd1c3f2114682f18bed28864d8515e4f206 (diff)
downloadllvm-a5464f3659a721328da98f7096390ac32f9ec6ed.tar.gz
llvm-a5464f3659a721328da98f7096390ac32f9ec6ed.tar.bz2
llvm-a5464f3659a721328da98f7096390ac32f9ec6ed.tar.xz
Create archives with the same permissions are ar.
Patch by Mikael Lepistö. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51540 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive')
-rw-r--r--lib/Archive/ArchiveWriter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp
index c5d54fba7e..2269464c6c 100644
--- a/lib/Archive/ArchiveWriter.cpp
+++ b/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;
}