summaryrefslogtreecommitdiff
path: root/test/test_unistd.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_unistd.rs')
-rw-r--r--test/test_unistd.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/test_unistd.rs b/test/test_unistd.rs
index fd4e327b..7ae01feb 100644
--- a/test/test_unistd.rs
+++ b/test/test_unistd.rs
@@ -64,7 +64,12 @@ fn test_wait() {
#[test]
fn test_mkstemp() {
- let result = mkstemp("/tmp/nix_tempfile.XXXXXX");
+ #[cfg(target_os = "android")]
+ let tmp = "/data/local/tmp/";
+ #[cfg(not(target_os = "android"))]
+ let tmp = "/tmp/";
+
+ let result = mkstemp((tmp.to_owned() + "nix_tempfile.XXXXXX").as_str());
match result {
Ok((fd, path)) => {
close(fd).unwrap();
@@ -73,7 +78,7 @@ fn test_mkstemp() {
Err(e) => panic!("mkstemp failed: {}", e)
}
- let result = mkstemp("/tmp/");
+ let result = mkstemp(tmp);
match result {
Ok(_) => {
panic!("mkstemp succeeded even though it should fail (provided a directory)");