From 00ec3cf2a0449f41bd3cb873bc9b2cf1b6241095 Mon Sep 17 00:00:00 2001 From: Nicolas Koch Date: Wed, 16 May 2018 10:17:06 +0200 Subject: Use copy_file_range on android also --- src/libstd/sys/unix/fs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index b9f0f39bbe2..42dc7b83da9 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -761,7 +761,7 @@ pub fn canonicalize(p: &Path) -> io::Result { Ok(PathBuf::from(OsString::from_vec(buf))) } -#[cfg(not(target_os = "linux"))] +#[cfg(not(any(target_os = "linux", target_os = "android")))] pub fn copy(from: &Path, to: &Path) -> io::Result { use fs::{File, set_permissions}; if !from.is_file() { @@ -778,7 +778,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result { Ok(ret) } -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android"))] pub fn copy(from: &Path, to: &Path) -> io::Result { use fs::{File, set_permissions}; @@ -812,7 +812,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result { let metadata = reader.metadata()?; (metadata.permissions(), metadata.size()) }; - + let mut written = 0u64; while written < len { let copy_result = unsafe { -- cgit 1.4.1-3-g733a5