Fix bug in raw_fd_istream::read_impl(). (#30)

It would not set error if read() returned 0 (indicating EOF).
This commit is contained in:
Peter Johnson
2017-09-06 22:06:21 -07:00
committed by GitHub
parent 041563f8ea
commit ef85809690

View File

@@ -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;
}