Skip to content

Commit

Permalink
Merge pull request #574 from stjepang/ignore-unread-errors
Browse files Browse the repository at this point in the history
Ignore seek errors in poll_unread
  • Loading branch information
yoshuawuyts authored Nov 21, 2019
2 parents ec54153 + 16edec3 commit 02e1d7e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,10 @@ impl LockGuard<State> {
if n > 0 {
// Seek `n` bytes backwards. This call should not block because it only changes
// the internal offset into the file and doesn't touch the actual file on disk.
(&*self.file).seek(SeekFrom::Current(-(n as i64)))?;
//
// We ignore errors here because special files like `/dev/random` are not
// seekable.
let _ = (&*self.file).seek(SeekFrom::Current(-(n as i64)));
}

// Switch to idle mode.
Expand Down

0 comments on commit 02e1d7e

Please sign in to comment.