Skip to content

Commit

Permalink
Merge pull request #39 from EFForg/fix-asyncio
Browse files Browse the repository at this point in the history
lib: ignore WriteZero for flush as well
  • Loading branch information
cooperq authored Feb 29, 2024
2 parents 6777372 + fa5f72d commit 68ce770
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/src/diag_device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,11 @@ impl DiagDevice {
return Err(DiagDeviceError::DeviceWriteFailed(err));
}
}
self.file.flush().await
.map_err(DiagDeviceError::DeviceWriteFailed)?;
if let Err(err) = self.file.flush().await {
if err.kind() != ErrorKind::WriteZero {
return Err(DiagDeviceError::DeviceWriteFailed(err));
}
}
Ok(())
}

Expand Down

0 comments on commit 68ce770

Please sign in to comment.