Skip to content

Commit

Permalink
Remove an unnecessary error mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
marmistrz committed Apr 2, 2020
1 parent 05a376e commit 6f90807
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions crates/wasi-common/src/sys/windows/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,29 +184,7 @@ pub(crate) fn link(
_ => e.into(),
})?;
}
fs::hard_link(&old_path, &new_path).or_else(|err| {
match err.raw_os_error() {
Some(code) => {
debug!("path_link at fs::hard_link error code={:?}", code);
match code as u32 {
// TODO is this needed at all????
winerror::ERROR_ACCESS_DENIED => {
// does the target exist?
if new_path.exists() {
return Err(Errno::Exist);
}
}
_ => {}
}

Err(err.into())
}
None => {
log::debug!("Inconvertible OS error: {}", err);
Err(Errno::Io)
}
}
})
fs::hard_link(&old_path, &new_path).map_err(Into::into)
}

pub(crate) fn open(
Expand Down

0 comments on commit 6f90807

Please sign in to comment.