mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-25 05:10:56 +00:00
Try to open the file before use data from stat.
Looks like on mingw we get bogus last modification times on directories. Should fix the mingw bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186240 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ee795f35f7
commit
718af78920
@ -560,6 +560,9 @@ static void performWriteOperation(ArchiveOperation Operation,
|
||||
sys::fs::file_status Status;
|
||||
failIfError(sys::fs::status(FileName, Status), FileName);
|
||||
|
||||
OwningPtr<MemoryBuffer> File;
|
||||
failIfError(MemoryBuffer::getFile(FileName, File), FileName);
|
||||
|
||||
uint64_t secondsSinceEpoch =
|
||||
Status.getLastModificationTime().toEpochTime();
|
||||
printWithSpacePadding(Out, secondsSinceEpoch, 12);
|
||||
@ -570,8 +573,6 @@ static void performWriteOperation(ArchiveOperation Operation,
|
||||
printWithSpacePadding(Out, Status.getSize(), 10);
|
||||
Out << "`\n";
|
||||
|
||||
OwningPtr<MemoryBuffer> File;
|
||||
failIfError(MemoryBuffer::getFile(FileName, File), FileName);
|
||||
Out << File->getBuffer();
|
||||
} else {
|
||||
object::Archive::child_iterator OldMember = I->getOld();
|
||||
|
Loading…
x
Reference in New Issue
Block a user