File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -807,14 +807,14 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
807
807
let perm = reader. metadata ( ) ?. permissions ( ) ;
808
808
809
809
let ret = io:: copy ( & mut reader, & mut writer) ?;
810
- set_permissions ( to , perm) ?;
810
+ writer . set_permissions ( perm) ?;
811
811
Ok ( ret)
812
812
}
813
813
814
814
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
815
815
pub fn copy ( from : & Path , to : & Path ) -> io:: Result < u64 > {
816
816
use cmp;
817
- use fs:: { File , set_permissions } ;
817
+ use fs:: File ;
818
818
use sync:: atomic:: { AtomicBool , Ordering } ;
819
819
820
820
// Kernel prior to 4.5 don't have copy_file_range
@@ -886,14 +886,14 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
886
886
// Try again with fallback method
887
887
assert_eq ! ( written, 0 ) ;
888
888
let ret = io:: copy ( & mut reader, & mut writer) ?;
889
- set_permissions ( to , perm) ?;
889
+ writer . set_permissions ( perm) ?;
890
890
return Ok ( ret)
891
891
} ,
892
892
_ => return Err ( err) ,
893
893
}
894
894
}
895
895
}
896
896
}
897
- set_permissions ( to , perm) ?;
897
+ writer . set_permissions ( perm) ?;
898
898
Ok ( written)
899
899
}
You can’t perform that action at this time.
0 commit comments