aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/FileOutputBuffer.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2013-03-14 00:20:10 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2013-03-14 00:20:10 +0000
commitcc3a595ab938352f3acf8652c5858ddf879524a5 (patch)
tree1f67c816387fd6a44ecf54063cc9c283b06642a3 /lib/Support/FileOutputBuffer.cpp
parent64a0a33307723957bf2f15e3181a290853c6f833 (diff)
[Support] Fix lifetime of file descriptors when using MemoryBuffer.
Clients of MemoryBuffer::getOpenFile expect it not to take ownership of the file descriptor passed in. So don't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176995 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/FileOutputBuffer.cpp')
-rw-r--r--lib/Support/FileOutputBuffer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Support/FileOutputBuffer.cpp b/lib/Support/FileOutputBuffer.cpp
index cd430f218b..1ee69b6023 100644
--- a/lib/Support/FileOutputBuffer.cpp
+++ b/lib/Support/FileOutputBuffer.cpp
@@ -70,8 +70,8 @@ error_code FileOutputBuffer::create(StringRef FilePath,
if (EC)
return EC;
- OwningPtr<mapped_file_region> MappedFile(
- new mapped_file_region(FD, mapped_file_region::readwrite, Size, 0, EC));
+ OwningPtr<mapped_file_region> MappedFile(new mapped_file_region(
+ FD, true, mapped_file_region::readwrite, Size, 0, EC));
if (EC)
return EC;