File tree 3 files changed +10
-5
lines changed
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -3,5 +3,5 @@ use nix::sys::pthread::*;
3
3
#[ test]
4
4
fn test_pthread_self ( ) {
5
5
let tid = pthread_self ( ) ;
6
- assert ! ( tid > 0 ) ;
6
+ assert ! ( tid != 0 ) ;
7
7
}
Original file line number Diff line number Diff line change 1
1
use nix:: net:: if_:: * ;
2
2
3
- #[ cfg( target_os = "linux" ) ]
3
+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
4
4
const LOOPBACK : & ' static [ u8 ] = b"lo" ;
5
5
6
- #[ cfg( not( target_os = "linux" ) ) ]
6
+ #[ cfg( not( any ( target_os = "android" , target_os = " linux") ) ) ]
7
7
const LOOPBACK : & ' static [ u8 ] = b"lo0" ;
8
8
9
9
#[ test]
Original file line number Diff line number Diff line change @@ -64,7 +64,12 @@ fn test_wait() {
64
64
65
65
#[ test]
66
66
fn test_mkstemp ( ) {
67
- let result = mkstemp ( "/tmp/nix_tempfile.XXXXXX" ) ;
67
+ #[ cfg( target_os = "android" ) ]
68
+ let tmp = "/data/local/tmp/" ;
69
+ #[ cfg( not( target_os = "android" ) ) ]
70
+ let tmp = "/tmp/" ;
71
+
72
+ let result = mkstemp ( ( tmp. to_owned ( ) + "nix_tempfile.XXXXXX" ) . as_str ( ) ) ;
68
73
match result {
69
74
Ok ( ( fd, path) ) => {
70
75
close ( fd) . unwrap ( ) ;
@@ -73,7 +78,7 @@ fn test_mkstemp() {
73
78
Err ( e) => panic ! ( "mkstemp failed: {}" , e)
74
79
}
75
80
76
- let result = mkstemp ( "/ tmp/" ) ;
81
+ let result = mkstemp ( tmp) ;
77
82
match result {
78
83
Ok ( _) => {
79
84
panic ! ( "mkstemp succeeded even though it should fail (provided a directory)" ) ;
You can’t perform that action at this time.
0 commit comments