@@ -491,11 +491,11 @@ fn recv(io: SockRef<'_>, bufs: &mut [IoSliceMut<'_>], meta: &mut [RecvMeta]) ->
491
491
}
492
492
493
493
let e = io:: Error :: last_os_error ( ) ;
494
- if e. kind ( ) == io:: ErrorKind :: Interrupted {
495
- continue ;
494
+ match e. kind ( ) {
495
+ // Retry receiving
496
+ io:: ErrorKind :: Interrupted => continue ,
497
+ _ => return Err ( e) ,
496
498
}
497
-
498
- return Err ( e) ;
499
499
} ;
500
500
for i in 0 ..( msg_count as usize ) {
501
501
meta[ i] = decode_recv ( & names[ i] , & hdrs[ i] . msg_hdr , hdrs[ i] . msg_len as usize ) ;
@@ -520,11 +520,11 @@ fn recv(io: SockRef<'_>, bufs: &mut [IoSliceMut<'_>], meta: &mut [RecvMeta]) ->
520
520
}
521
521
522
522
let e = io:: Error :: last_os_error ( ) ;
523
- if e. kind ( ) == io:: ErrorKind :: Interrupted {
524
- continue ;
523
+ match e. kind ( ) {
524
+ // Retry receiving
525
+ io:: ErrorKind :: Interrupted => continue ,
526
+ _ => return Err ( e) ,
525
527
}
526
-
527
- return Err ( e) ;
528
528
} ;
529
529
for i in 0 ..( msg_count as usize ) {
530
530
meta[ i] = decode_recv ( & names[ i] , & hdrs[ i] , hdrs[ i] . msg_datalen as usize ) ;
@@ -550,11 +550,11 @@ fn recv(io: SockRef<'_>, bufs: &mut [IoSliceMut<'_>], meta: &mut [RecvMeta]) ->
550
550
}
551
551
552
552
let e = io:: Error :: last_os_error ( ) ;
553
- if e. kind ( ) == io:: ErrorKind :: Interrupted {
554
- continue ;
553
+ match e. kind ( ) {
554
+ // Retry receiving
555
+ io:: ErrorKind :: Interrupted => continue ,
556
+ _ => return Err ( e) ,
555
557
}
556
-
557
- return Err ( e) ;
558
558
} ;
559
559
meta[ 0 ] = decode_recv ( & name, & hdr, n as usize ) ;
560
560
Ok ( 1 )
0 commit comments