termwiz: avoid emitting a wake event on a spurious pipe wakeup

This commit is contained in:
Wez Furlong committed 2019-06-02 18:27:15 -07:00
1 parent ae303fea56
commit c0e3bdfb70
1 file changed
+4 -2
+4 -2
View File
@@ -457,8 +457,10 @@ impl Terminal for UnixTerminal {
if pfd[2].revents != 0 {
let mut buf = [0u8; 64];
if self.wake_pipe.read(&mut buf).is_ok() {
return Ok(Some(InputEvent::Wake));
if let Ok(n) = self.wake_pipe.read(&mut buf) {
if n > 0 {
return Ok(Some(InputEvent::Wake));
}
}
}