about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorNicolas Koch <nioko1337@gmail.com>2018-05-16 10:17:06 +0200
committerNicolas Koch <nioko1337@gmail.com>2018-05-16 10:17:06 +0200
commit00ec3cf2a0449f41bd3cb873bc9b2cf1b6241095 (patch)
tree0e6e61303222623ff95e58a0afaaf32f4b3cd856 /src/libstd
parentb4b71d5d5fd8bedecbacf08ffb45c8456700151b (diff)
downloadrust-00ec3cf2a0449f41bd3cb873bc9b2cf1b6241095.tar.gz
rust-00ec3cf2a0449f41bd3cb873bc9b2cf1b6241095.zip
Use copy_file_range on android also
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/sys/unix/fs.rs6
1 files changed, 3 insertions, 3 deletions
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<PathBuf> {
     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<u64> {
     use fs::{File, set_permissions};
     if !from.is_file() {
@@ -778,7 +778,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
     Ok(ret)
 }
 
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", target_os = "android"))]
 pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
     use fs::{File, set_permissions};
 
@@ -812,7 +812,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
         let metadata = reader.metadata()?;
         (metadata.permissions(), metadata.size())
     };
-    
+
     let mut written = 0u64;
     while written < len {
         let copy_result = unsafe {