forked from mirror/async-std
Merge pull request #574 from stjepang/ignore-unread-errors
Ignore seek errors in poll_unread
This commit is contained in:
commit
02e1d7e5ea
1 changed files with 4 additions and 1 deletions
|
@ -742,7 +742,10 @@ impl LockGuard<State> {
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
// Seek `n` bytes backwards. This call should not block because it only changes
|
// 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.
|
// 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.
|
// Switch to idle mode.
|
||||||
|
|
Loading…
Reference in a new issue