Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ unix = [
"generic"
]
windows = ["generic"]
windows_legacy = [
"arch",
"nproc",
"sync",
"touch",
"whoami",

"redox_generic"
]
# Feature "fuchsia" contains the exclusive list of utilities
# that can be compiled and run on Fuchsia. Should be built
# with --no-default-features when selecting this feature.
Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn main() {
if val == "1" && key.starts_with(feature_prefix) {
let krate = key[feature_prefix.len()..].to_lowercase();
match krate.as_ref() {
"default" | "unix" | "redox" | "redox_generic" | "fuchsia" | "generic" | "windows"
"default" | "unix" | "redox" | "redox_generic" | "fuchsia" | "generic" | "windows" | "windows_legacy"
| "nightly" | "test_unimplemented" => continue,
_ => {}
}
Expand Down
6 changes: 4 additions & 2 deletions src/cp/cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extern crate kernel32;
#[cfg(windows)]
use kernel32::GetFileInformationByHandle;
#[cfg(windows)]
use kernel32::CreateFile2;
use kernel32::CreateFileW;
#[cfg(windows)]
extern crate winapi;

Expand Down Expand Up @@ -731,10 +731,12 @@ fn preserve_hardlinks(
#[cfg(windows)]
{
let stat = mem::uninitialized();
let handle = CreateFile2(
let handle = CreateFileW(
src_path.as_ptr() as *const u16,
winapi::um::winnt::GENERIC_READ,
winapi::um::winnt::FILE_SHARE_READ,
std::ptr::null_mut(),
0,
0,
std::ptr::null_mut(),
);
Expand Down