This function will be invoked whenever the timeout is reached before any other event was triggered while waiting for the epoll.
(&mut self, helper: &mut EpollHelper)
| 493 | // This function will be invoked whenever the timeout is reached before |
| 494 | // any other event was triggered while waiting for the epoll. |
| 495 | fn handle_timeout(&mut self, helper: &mut EpollHelper) -> Result<(), EpollHelperError> { |
| 496 | if !self.endpoint.is_pty() { |
| 497 | return Ok(()); |
| 498 | } |
| 499 | |
| 500 | if self.file_event_registered { |
| 501 | // This very specific case happens when the console is connected |
| 502 | // to a PTY. We know EPOLLHUP is always present when there's nothing |
| 503 | // connected at the other end of the PTY. That's why getting no event |
| 504 | // means we can flush the output of the console through the PTY. |
| 505 | self.trigger_pty_flush() |
| 506 | .map_err(EpollHelperError::HandleTimeout)?; |
| 507 | } |
| 508 | |
| 509 | // Every time we hit the timeout, let's register the FILE_EVENT to give |
| 510 | // us a chance to catch a possible event that might have been triggered. |
| 511 | self.register_file_event(helper) |
| 512 | } |
| 513 | |
| 514 | // This function returns the full list of events found on the epoll before |
| 515 | // iterating through it calling handle_event(). It allows the detection of |
nothing calls this directly
no test coverage detected