File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -656,8 +656,9 @@ impl<T: AsFd> Async<T> {
656
656
/// # std::io::Result::Ok(()) });
657
657
/// ```
658
658
pub fn new ( io : T ) -> io:: Result < Async < T > > {
659
- // Put the file descriptor in non-blocking mode.
660
659
let fd = io. as_fd ( ) ;
660
+
661
+ // Put the file descriptor in non-blocking mode.
661
662
set_nonblocking ( fd) ?;
662
663
663
664
// SAFETY: It is impossible to drop the I/O source while it is registered through
@@ -733,11 +734,7 @@ impl<T: AsSocket> Async<T> {
733
734
let borrowed = io. as_socket ( ) ;
734
735
735
736
// Put the socket in non-blocking mode.
736
- //
737
- // Safety: We assume `as_raw_socket()` returns a valid fd. When we can
738
- // depend on Rust >= 1.63, where `AsFd` is stabilized, and when
739
- // `TimerFd` implements it, we can remove this unsafe and simplify this.
740
- rustix:: io:: ioctl_fionbio ( borrowed, true ) ?;
737
+ set_nonblocking ( borrowed) ?;
741
738
742
739
// Create the registration.
743
740
//
You can’t perform that action at this time.
0 commit comments