11use rustix:: fd:: { AsFd , AsRawFd , FromRawFd , IntoRawFd , OwnedFd } ;
22#[ cfg( not( windows) ) ]
3- use rustix:: io:: { poll, with_retrying } ;
3+ use rustix:: io:: { poll, retry_on_intr } ;
44use rustix:: io:: { PollFd , PollFlags } ;
55
66#[ cfg( not( windows) ) ]
@@ -14,16 +14,16 @@ fn test_poll() {
1414 assert_eq ! ( poll_fds[ 0 ] . as_fd( ) . as_raw_fd( ) , reader. as_fd( ) . as_raw_fd( ) ) ;
1515
1616 // `poll` should say there's nothing ready to be read from the pipe.
17- let num = with_retrying ( || poll ( & mut poll_fds, 0 ) ) . unwrap ( ) ;
17+ let num = retry_on_intr ( || poll ( & mut poll_fds, 0 ) ) . unwrap ( ) ;
1818 assert_eq ! ( num, 0 ) ;
1919 assert ! ( poll_fds[ 0 ] . revents( ) . is_empty( ) ) ;
2020 assert_eq ! ( poll_fds[ 0 ] . as_fd( ) . as_raw_fd( ) , reader. as_fd( ) . as_raw_fd( ) ) ;
2121
2222 // Write a byte to the pipe.
23- assert_eq ! ( with_retrying ( || write( & writer, b"a" ) ) . unwrap( ) , 1 ) ;
23+ assert_eq ! ( retry_on_intr ( || write( & writer, b"a" ) ) . unwrap( ) , 1 ) ;
2424
2525 // `poll` should now say there's data to be read.
26- let num = with_retrying ( || poll ( & mut poll_fds, -1 ) ) . unwrap ( ) ;
26+ let num = retry_on_intr ( || poll ( & mut poll_fds, -1 ) ) . unwrap ( ) ;
2727 assert_eq ! ( num, 1 ) ;
2828 assert_eq ! ( poll_fds[ 0 ] . revents( ) , PollFlags :: IN ) ;
2929 assert_eq ! ( poll_fds[ 0 ] . as_fd( ) . as_raw_fd( ) , reader. as_fd( ) . as_raw_fd( ) ) ;
@@ -35,12 +35,12 @@ fn test_poll() {
3535
3636 // Read the byte from the pipe.
3737 let mut buf = [ b'\0' ] ;
38- assert_eq ! ( with_retrying ( || read( & reader, & mut buf) ) . unwrap( ) , 1 ) ;
38+ assert_eq ! ( retry_on_intr ( || read( & reader, & mut buf) ) . unwrap( ) , 1 ) ;
3939 assert_eq ! ( buf[ 0 ] , b'a' ) ;
4040 assert_eq ! ( poll_fds[ 0 ] . as_fd( ) . as_raw_fd( ) , reader. as_fd( ) . as_raw_fd( ) ) ;
4141
4242 // Poll should now say there's no more data to be read.
43- let num = with_retrying ( || poll ( & mut poll_fds, 0 ) ) . unwrap ( ) ;
43+ let num = retry_on_intr ( || poll ( & mut poll_fds, 0 ) ) . unwrap ( ) ;
4444 assert_eq ! ( num, 0 ) ;
4545 assert ! ( poll_fds[ 0 ] . revents( ) . is_empty( ) ) ;
4646 assert_eq ! ( poll_fds[ 0 ] . as_fd( ) . as_raw_fd( ) , reader. as_fd( ) . as_raw_fd( ) ) ;
0 commit comments