1
+ #[ cfg( any(
2
+ target_os = "linux" ,
3
+ target_os = "android" ,
4
+ target_os = "dragonfly" ,
5
+ target_os = "freebsd" ,
6
+ target_os = "openbsd" ,
7
+ target_os = "netbsd" ,
8
+ target_os = "solaris" ,
9
+ target_os = "illumos" ,
10
+ target_os = "haiku" ,
11
+ target_os = "nto" ,
12
+ target_os = "cygwin"
13
+ ) ) ]
14
+ use libc:: MSG_NOSIGNAL ;
15
+
1
16
use super :: { SocketAddr , sockaddr_un} ;
2
17
#[ cfg( any( doc, target_os = "android" , target_os = "linux" ) ) ]
3
18
use super :: { SocketAncillary , recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to} ;
@@ -13,9 +28,7 @@ use super::{SocketAncillary, recv_vectored_with_ancillary_from, send_vectored_wi
13
28
target_os = "cygwin"
14
29
) ) ]
15
30
use super :: { UCred , peer_cred} ;
16
- use crate :: cmp;
17
31
use crate :: ffi:: c_void;
18
- use crate :: fmt;
19
32
use crate :: io:: { self , IoSlice , IoSliceMut } ;
20
33
use crate :: net:: Shutdown ;
21
34
use crate :: os:: unix:: io:: { AsFd , AsRawFd , BorrowedFd , FromRawFd , IntoRawFd , OwnedFd , RawFd } ;
@@ -25,20 +38,8 @@ use crate::sys::cvt;
25
38
use crate :: sys:: net:: { Socket , wrlen_t} ;
26
39
use crate :: sys_common:: { AsInner , FromInner } ;
27
40
use crate :: time:: Duration ;
28
- #[ cfg( any(
29
- target_os = "linux" ,
30
- target_os = "android" ,
31
- target_os = "dragonfly" ,
32
- target_os = "freebsd" ,
33
- target_os = "openbsd" ,
34
- target_os = "netbsd" ,
35
- target_os = "solaris" ,
36
- target_os = "illumos" ,
37
- target_os = "haiku" ,
38
- target_os = "nto" ,
39
- target_os = "cygwin"
40
- ) ) ]
41
- use libc:: MSG_NOSIGNAL ;
41
+ use crate :: { cmp, fmt} ;
42
+
42
43
#[ cfg( not( any(
43
44
target_os = "linux" ,
44
45
target_os = "android" ,
@@ -666,8 +667,8 @@ impl<'a> io::Write for &'a UnixStream {
666
667
let len = cmp:: min ( buf. len ( ) , <wrlen_t >:: MAX as usize ) as wrlen_t ;
667
668
let ret = cvt ( unsafe {
668
669
libc:: send ( self . 0 . as_raw ( ) , buf. as_ptr ( ) as * const c_void , len, MSG_NOSIGNAL )
669
- } ) ?;
670
- Ok ( ret as usize )
670
+ } ) ?;
671
+ Ok ( ret as usize )
671
672
}
672
673
673
674
fn write_vectored ( & mut self , bufs : & [ IoSlice < ' _ > ] ) -> io:: Result < usize > {
0 commit comments