From ef85809690c55738ec1dd93063f5851ef02c303d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 6 Sep 2017 22:06:21 -0700 Subject: [PATCH] Fix bug in raw_fd_istream::read_impl(). (#30) It would not set error if read() returned 0 (indicating EOF). --- src/main/native/cpp/support/raw_istream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/native/cpp/support/raw_istream.cpp b/src/main/native/cpp/support/raw_istream.cpp index 39e1738841..0ae7cf2868 100644 --- a/src/main/native/cpp/support/raw_istream.cpp +++ b/src/main/native/cpp/support/raw_istream.cpp @@ -117,7 +117,7 @@ void raw_fd_istream::read_impl(void* data, std::size_t len) { #else ssize_t count = ::read(m_fd, m_buf, m_bufSize); #endif - if (count < 0) { + if (count <= 0) { error_detected(); return; }