projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e8bc45a
)
Make this code more robust by not thinking we are making progress
author
Duncan Sands
<baldrick@free.fr>
Tue, 3 Nov 2009 19:10:22 +0000
(19:10 +0000)
committer
Duncan Sands
<baldrick@free.fr>
Tue, 3 Nov 2009 19:10:22 +0000
(19:10 +0000)
if zero bytes were read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85922
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/MemoryBuffer.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/MemoryBuffer.cpp
b/lib/Support/MemoryBuffer.cpp
index e35c626c4086e45521ca40dbc69539383ec8e0a1..d8b6b9f76fe6b596765c9347bf798c250f24972c 100644
(file)
--- a/
lib/Support/MemoryBuffer.cpp
+++ b/
lib/Support/MemoryBuffer.cpp
@@
-226,7
+226,7
@@
MemoryBuffer *MemoryBuffer::getFile(const char *Filename, std::string *ErrStr,
size_t BytesLeft = FileSize;
while (BytesLeft) {
ssize_t NumRead = ::read(FD, BufPtr, BytesLeft);
- if (NumRead
!= -1
) {
+ if (NumRead
> 0
) {
BytesLeft -= NumRead;
BufPtr += NumRead;
} else if (errno == EINTR) {