#endif
#ifdef _WIN32
- ClearCommError(port->hdl, &errors, &status);
+ if (ClearCommError(port->hdl, &errors, &status) == 0)
+ RETURN_FAIL("ClearCommError() failed");
#endif
ret = set_config(port, &data, &config);
COMSTAT comstat;
if (ClearCommError(port->hdl, &errors, &comstat) == 0)
- RETURN_FAIL("ClearComError() failed");
+ RETURN_FAIL("ClearCommError() failed");
RETURN_VALUE("%d", comstat.cbInQue);
#else
int bytes_waiting;
COMSTAT comstat;
if (ClearCommError(port->hdl, &errors, &comstat) == 0)
- RETURN_FAIL("ClearComError() failed");
+ RETURN_FAIL("ClearCommError() failed");
RETURN_VALUE("%d", comstat.cbOutQue);
#else
int bytes_waiting;