File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 11use std:: mem;
2+ use std:: mem:: MaybeUninit ;
23use std:: ops:: { Deref , DerefMut } ;
34use std:: os:: fd:: { AsRawFd , FromRawFd , OwnedFd , RawFd } ;
5+ use std:: slice;
46#[ cfg( debug_assertions) ]
57use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
68use std:: time:: Duration ;
79use std:: { cmp, io, ptr} ;
810
11+ use crate :: Interest ;
912use crate :: Token ;
1013
11- cfg_io_source ! {
12- use std:: mem:: MaybeUninit ;
13- use std:: slice;
14-
15- use crate :: Interest ;
16- }
17-
1814/// Unique id for use as `SelectorId`.
1915#[ cfg( debug_assertions) ]
2016static NEXT_ID : AtomicUsize = AtomicUsize :: new ( 1 ) ;
@@ -129,7 +125,6 @@ impl Selector {
129125 } )
130126 }
131127
132- cfg_io_source ! {
133128 pub fn register ( & self , fd : RawFd , token : Token , interests : Interest ) -> io:: Result < ( ) > {
134129 let flags = libc:: EV_CLEAR | libc:: EV_RECEIPT | libc:: EV_ADD ;
135130 // At most we need two changes, but maybe we only need 1.
@@ -169,6 +164,7 @@ impl Selector {
169164 kevent_register ( self . kq . as_raw_fd ( ) , changes, & [ libc:: EPIPE as i64 ] )
170165 }
171166
167+ cfg_io_source ! {
172168 pub fn reregister( & self , fd: RawFd , token: Token , interests: Interest ) -> io:: Result <( ) > {
173169 let flags = libc:: EV_CLEAR | libc:: EV_RECEIPT ;
174170 let write_flags = if interests. is_writable( ) {
You can’t perform that action at this time.
0 commit comments