From 26cbf3a04b0a86e977a23979ccf631d9bf58d9ec Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sat, 13 Jan 2024 00:20:33 -0800 Subject: [PATCH] Fix more test failures Signed-off-by: John Nunley --- src/sources/ping/iocp.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sources/ping/iocp.rs b/src/sources/ping/iocp.rs index c7aa0bf5..42472480 100644 --- a/src/sources/ping/iocp.rs +++ b/src/sources/ping/iocp.rs @@ -104,9 +104,8 @@ impl EventSource for PingSource { let poll_state = match &mut counter.poll_state { Some(ps) => ps, None => { - return Err(super::PingError(Box::new(io::Error::from( - io::ErrorKind::NotFound, - )))); + // We were deregistered; remove ourselves from the list. + return Ok(crate::PostAction::Remove); } }; @@ -121,6 +120,7 @@ impl EventSource for PingSource { poll_state.packet.event().key, token ); + return Ok(PostAction::Continue); } // Tell if we are registered. @@ -132,7 +132,7 @@ impl EventSource for PingSource { } // Stop looping if all of the Ping's have been dropped. - let action = if Arc::strong_count(&self.state) == 1 { + let action = if Arc::strong_count(&self.state) <= 1 { crate::PostAction::Remove } else { crate::PostAction::Continue