File tree Expand file tree Collapse file tree 4 files changed +12
-27
lines changed Expand file tree Collapse file tree 4 files changed +12
-27
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ exclude = [
17
17
18
18
[features ]
19
19
execvpe = []
20
- signalfd = []
21
20
22
21
[dependencies ]
23
22
libc = " 0.2.25"
@@ -36,12 +35,6 @@ nix-test = { path = "nix-test", version = "0.0.1" }
36
35
name = " test"
37
36
path = " test/test.rs"
38
37
39
- [[test ]]
40
- name = " test-signalfd"
41
- path = " test/test_signalfd.rs"
42
- harness = false
43
- test = true
44
-
45
38
[[test ]]
46
39
name = " test-mount"
47
40
path = " test/test_mount.rs"
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ pub mod sendfile;
24
24
pub mod signal;
25
25
26
26
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
27
- #[ cfg( feature = "signalfd" ) ]
28
27
pub mod signalfd;
29
28
30
29
pub mod socket;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ extern crate nix_test as nixtest;
11
11
12
12
mod sys;
13
13
mod test_fcntl;
14
- #[ cfg( any ( target_os = "linux" ) ) ]
14
+ #[ cfg( target_os = "linux" ) ]
15
15
mod test_mq;
16
16
mod test_net;
17
17
mod test_nix_path;
@@ -20,6 +20,8 @@ mod test_poll;
20
20
mod test_pty;
21
21
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
22
22
mod test_sendfile;
23
+ #[ cfg( target_os = "linux" ) ]
24
+ mod test_signalfd;
23
25
mod test_stat;
24
26
mod test_unistd;
25
27
Original file line number Diff line number Diff line change 1
- extern crate nix;
2
-
3
- #[ cfg( feature = "signalfd" ) ]
4
- use nix:: sys:: signalfd:: SignalFd ;
5
- #[ cfg( feature = "signalfd" ) ]
6
- use nix:: sys:: signal;
7
- #[ cfg( feature = "signalfd" ) ]
8
- use nix:: unistd;
9
-
10
- #[ cfg( feature = "signalfd" ) ]
11
- fn main ( ) {
12
- print ! ( "test test_signalfd ... " ) ;
1
+ #[ cfg( target_os = "linux" ) ]
2
+ #[ test]
3
+ fn test_signalfd ( ) {
4
+ use nix:: sys:: signalfd:: SignalFd ;
5
+ use nix:: sys:: signal;
6
+ use nix:: unistd;
13
7
14
8
let mut mask = signal:: SigSet :: empty ( ) ;
15
- mask. add ( signal:: SIGUSR1 ) . unwrap ( ) ;
9
+ mask. add ( signal:: SIGUSR1 ) ;
16
10
mask. thread_block ( ) . unwrap ( ) ;
17
11
18
12
let mut fd = SignalFd :: new ( & mask) . unwrap ( ) ;
@@ -22,9 +16,6 @@ fn main() {
22
16
23
17
let res = fd. read_signal ( ) ;
24
18
25
- assert_eq ! ( res. unwrap( ) . unwrap( ) . ssi_signo as i32 , signal :: SIGUSR1 ) ;
26
- println ! ( "ok" ) ;
19
+ let signo = signal :: Signal :: from_c_int ( res. unwrap ( ) . unwrap ( ) . ssi_signo as i32 ) . unwrap ( ) ;
20
+ assert_eq ! ( signo , signal :: SIGUSR1 ) ;
27
21
}
28
-
29
- #[ cfg( not( feature = "signalfd" ) ) ]
30
- fn main ( ) { }
You can’t perform that action at this time.
0 commit comments