From 7127b13342f25a1fa06ed2c6f81891d3613df3fd Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Wed, 4 Nov 2009 20:50:23 +0000 Subject: [PATCH] A value is only assigned to errno if NumRead equals -1, so do not reason based on errno if NumRead has a different value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86046 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/MemoryBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp index d8b6b9f76fe..88e2050a9a9 100644 --- a/lib/Support/MemoryBuffer.cpp +++ b/lib/Support/MemoryBuffer.cpp @@ -229,7 +229,7 @@ MemoryBuffer *MemoryBuffer::getFile(const char *Filename, std::string *ErrStr, if (NumRead > 0) { BytesLeft -= NumRead; BufPtr += NumRead; - } else if (errno == EINTR) { + } else if (NumRead == -1 && errno == EINTR) { // try again } else { // error reading.