File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 88 libc:: mode_t,
99 std:: {
1010 ffi:: { CString , OsStr } ,
11+ io,
1112 mem:: zeroed,
1213 os:: unix:: prelude:: * ,
1314 sync:: Arc ,
@@ -37,9 +38,22 @@ fn test_inner(path: bool) -> TestResult {
3738 const MODE : libc:: mode_t = 0o600 ;
3839 let ( name, listener) =
3940 listen_and_pick_name ( & mut namegen_local_socket ( make_id ! ( ) , path) , |nm| {
40- ListenerOptions :: new ( ) . name ( nm. borrow ( ) ) . mode ( MODE ) . create_sync ( )
41+ let rslt =
42+ ListenerOptions :: new ( ) . name ( nm. borrow ( ) ) . mode ( MODE ) . create_sync ( ) . map ( Some ) ;
43+ if cfg ! ( target_os = "openbsd" ) {
44+ return if rslt. is_ok ( ) {
45+ Err ( io:: Error :: other ( "unexpected success, please update this test" ) )
46+ } else {
47+ Ok ( None )
48+ } ;
49+ }
50+ rslt
4151 } ) ?;
52+
53+ // If listener is None, we're on a platform on which we expect this to not be supported
54+ let Some ( listener) = listener else { return Ok ( ( ) ) } ;
4255 let name = Arc :: try_unwrap ( name) . unwrap ( ) ;
56+
4357 let _ = Stream :: connect ( name. borrow ( ) ) . opname ( "client connect" ) ?;
4458 let actual_mode = if let Name ( NameInner :: UdSocketPath ( path) ) = name {
4559 get_file_mode ( & path)
You can’t perform that action at this time.
0 commit comments