Skip to content

Commit

Permalink
Fix TIOCMIWAIT ioctl call
Browse files Browse the repository at this point in the history
This issue was reported in wjwwood/serial#224.
  • Loading branch information
alextoind committed Jun 27, 2020
1 parent 7dd4a89 commit 6f8fc11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/impl/impl_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,9 +840,9 @@ bool Serial::SerialImpl::waitForChange() const {
#else
int command = (TIOCM_CD | TIOCM_DSR | TIOCM_RI | TIOCM_CTS);

if (-1 == ioctl(fd_, TIOCMIWAIT, &command)) {
if (-1 == ioctl(fd_, TIOCMIWAIT, command)) {
std::stringstream ss;
ss << "waitForDSR failed on a call to ioctl(TIOCMIWAIT): " << errno << " " << strerror(errno);
ss << "waitForChange failed on a call to ioctl(TIOCMIWAIT): " << errno << " " << strerror(errno);
throw (SerialException(ss.str().c_str()));
}
return true;
Expand Down

0 comments on commit 6f8fc11

Please sign in to comment.