File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ use std::io::Write;
5
5
6
6
#[ test]
7
7
fn test_seals ( ) {
8
- let fd = memfd_create ( "test" , MemfdFlags :: CLOEXEC | MemfdFlags :: ALLOW_SEALING ) . unwrap ( ) ;
8
+ let fd = match memfd_create ( "test" , MemfdFlags :: CLOEXEC | MemfdFlags :: ALLOW_SEALING ) {
9
+ Ok ( fd) => fd,
10
+ Err ( rustix:: io:: Error :: NOSYS ) => return ,
11
+ Err ( err) => Err ( err) . unwrap ( ) ,
12
+ } ;
9
13
let mut file = File :: from_fd ( fd. into ( ) ) ;
10
14
11
15
writeln ! ( & mut file, "Hello!" ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -26,7 +26,11 @@ fn test_prlimit() {
26
26
27
27
let first = rustix:: process:: getrlimit ( Resource :: Core ) ;
28
28
29
- let old = rustix:: process:: prlimit ( None , Resource :: Core , new. clone ( ) ) . unwrap ( ) ;
29
+ let old = match rustix:: process:: prlimit ( None , Resource :: Core , new. clone ( ) ) {
30
+ Ok ( rlimit) => rlimit,
31
+ Err ( rustix:: io:: Error :: NOSYS ) => return ,
32
+ Err ( e) => Err ( e) . unwrap ( ) ,
33
+ } ;
30
34
31
35
assert_eq ! ( first, old) ;
32
36
You can’t perform that action at this time.
0 commit comments