Skip to content

Commit 02e1d7e

Browse files
authored
Merge pull request #574 from stjepang/ignore-unread-errors
Ignore seek errors in poll_unread
2 parents ec54153 + 16edec3 commit 02e1d7e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/fs/file.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,10 @@ impl LockGuard<State> {
742742
if n > 0 {
743743
// Seek `n` bytes backwards. This call should not block because it only changes
744744
// the internal offset into the file and doesn't touch the actual file on disk.
745-
(&*self.file).seek(SeekFrom::Current(-(n as i64)))?;
745+
//
746+
// We ignore errors here because special files like `/dev/random` are not
747+
// seekable.
748+
let _ = (&*self.file).seek(SeekFrom::Current(-(n as i64)));
746749
}
747750

748751
// Switch to idle mode.

0 commit comments

Comments
 (0)