From 16edec346498f3a6e32869b78b57c63ca826cc17 Mon Sep 17 00:00:00 2001 From: Stjepan Glavina Date: Thu, 21 Nov 2019 17:50:30 +0100 Subject: [PATCH] Ignore seek errors in poll_unread --- src/fs/file.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fs/file.rs b/src/fs/file.rs index f8242811..94e2989b 100644 --- a/src/fs/file.rs +++ b/src/fs/file.rs @@ -742,7 +742,10 @@ impl LockGuard { 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.