From 867679446e5d1470552203f398a6700880e8379a Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Mon, 25 Mar 2024 20:37:53 +0400 Subject: [PATCH] Ignore socketpair(2) errors when sending (#36) --- lib/host.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/host.rs b/lib/host.rs index aaf2f95..6f3a930 100644 --- a/lib/host.rs +++ b/lib/host.rs @@ -74,7 +74,9 @@ impl Host { interface .set_event_callback(Events::PACKETS_AVAILABLE, move |_mask, _params| { // Send a dummy datagram to make the other end of socketpair() readable - new_packets_tx.send(&[0; 1]).unwrap(); + // and ignore the error as this merely a signalling channel to wake up + // the poller + new_packets_tx.send(&[0; 1]).ok(); // Wait for the permission to continue to avoid // wasting CPU cycles or in case of termination,