mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-30 17:33:24 +00:00
Make this code more robust by not thinking we are making progress
if zero bytes were read. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e8bc45a645
commit
954cb43c80
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user