aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/MemoryBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/MemoryBuffer.cpp')
-rw-r--r--lib/Support/MemoryBuffer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp
index 65b4332..b0a2085 100644
--- a/lib/Support/MemoryBuffer.cpp
+++ b/lib/Support/MemoryBuffer.cpp
@@ -322,9 +322,9 @@ error_code MemoryBuffer::getOpenFile(int FD, const char *Filename,
return error_code(errno, posix_category());
}
- // If this is a named pipe, we can't trust the size. Create the memory
- // buffer by copying off the stream.
- if (S_ISFIFO(FileInfo.st_mode)) {
+ // If this is a named pipe or character device, we can't trust the size.
+ // Create the memory buffer by copying off the stream.
+ if (S_ISFIFO(FileInfo.st_mode) || S_ISCHR(FileInfo.st_mode)) {
return getMemoryBufferForStream(FD, Filename, result);
}