Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing Mac serial issue when ReadFile returns EAGAIN

  • Loading branch information...
commit 76db9dffcfc1ace689200d8e8579ab317c52862e 1 parent ed757b0
@andrewfb andrewfb authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  src/cinder/Serial.cpp
View
3  src/cinder/Serial.cpp
@@ -258,7 +258,8 @@ void Serial::readBytes( void *data, size_t numBytes )
if( ! ::ReadFile( mObj->mDeviceHandle, data, numBytes - totalBytesRead, &bytesRead, 0 ) )
throw SerialExcReadFailure();
#endif
- totalBytesRead += bytesRead;
+ if( bytesRead != -1 )
+ totalBytesRead += bytesRead;
// yield thread time to the system
thread::yield();
Please sign in to comment.
Something went wrong with that request. Please try again.