aboutsummaryrefslogtreecommitdiff
path: root/llvm/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
commit42ad29fa055dba473cf4cb5e9abb1a7d35f2afd2 (patch)
tree594c8b33ff3ce666e1c9dd665b45f77e1ca4dfac /llvm/lib/Support/FileOutputBuffer.cpp
parentad145509ebd78d615fe5232b7e6760e7a2132d43 (diff)
downloadllvm-42ad29fa055dba473cf4cb5e9abb1a7d35f2afd2.zip
llvm-42ad29fa055dba473cf4cb5e9abb1a7d35f2afd2.tar.gz
llvm-42ad29fa055dba473cf4cb5e9abb1a7d35f2afd2.tar.bz2
[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. llvm-svn: 176995
Diffstat (limited to 'llvm/lib/Support/FileOutputBuffer.cpp')
-rw-r--r--llvm/lib/Support/FileOutputBuffer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/FileOutputBuffer.cpp b/llvm/lib/Support/FileOutputBuffer.cpp
index cd430f2..1ee69b6 100644
--- a/llvm/lib/Support/FileOutputBuffer.cpp
+++ b/llvm/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;