From 026a41d351002be0c3f5834397b8225cdb23e993 Mon Sep 17 00:00:00 2001 From: Folkert Date: Wed, 5 Apr 2023 13:24:35 +0200 Subject: [PATCH] keep original interest for PollEvented::new --- tokio/src/io/poll_evented.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tokio/src/io/poll_evented.rs b/tokio/src/io/poll_evented.rs index 5e131ed3f1b..875ad7e0d0a 100644 --- a/tokio/src/io/poll_evented.rs +++ b/tokio/src/io/poll_evented.rs @@ -70,17 +70,12 @@ cfg_io_driver! { // ===== impl PollEvented ===== -#[cfg(not(any(target_os = "linux", target_os = "android")))] -const ALL_INTEREST: Interest = Interest::READABLE.add(Interest::WRITABLE); - -#[cfg(any(target_os = "linux", target_os = "android"))] -const ALL_INTEREST: Interest = Interest::READABLE - .add(Interest::WRITABLE) - .add(Interest::PRIORITY); - impl PollEvented { /// Creates a new `PollEvented` associated with the default reactor. /// + /// The returned `PollEvented` has readable and writable interests. For more control, use + /// [`Self::new_with_interest`]. + /// /// # Panics /// /// This function panics if thread-local runtime is not set. @@ -91,7 +86,7 @@ impl PollEvented { #[track_caller] #[cfg_attr(feature = "signal", allow(unused))] pub(crate) fn new(io: E) -> io::Result { - PollEvented::new_with_interest(io, ALL_INTEREST) + PollEvented::new_with_interest(io, Interest::READABLE | Interest::WRITABLE) } /// Creates a new `PollEvented` associated with the default reactor, for