Skip to content

Commit

Permalink
Merge pull request #28 from Polprzewodnikowy/fix-unix-write-timeout
Browse files Browse the repository at this point in the history
Fix write timeout for Unix platforms
  • Loading branch information
de-vri-es authored Mar 4, 2024
2 parents e7baadf + cbb18cf commit cc08aa6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sys/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl SerialPort {
}

pub fn write(&self, buf: &[u8]) -> std::io::Result<usize> {
if !poll(&self.file, libc::POLLOUT, self.read_timeout_ms)? {
if !poll(&self.file, libc::POLLOUT, self.write_timeout_ms)? {
return Err(std::io::ErrorKind::TimedOut.into());
}
unsafe {
Expand All @@ -234,7 +234,7 @@ impl SerialPort {
}

pub fn write_vectored(&self, buf: &[IoSlice<'_>]) -> std::io::Result<usize> {
if !poll(&self.file, libc::POLLOUT, self.read_timeout_ms)? {
if !poll(&self.file, libc::POLLOUT, self.write_timeout_ms)? {
return Err(std::io::ErrorKind::TimedOut.into());
}
unsafe {
Expand Down

0 comments on commit cc08aa6

Please sign in to comment.