Skip to content

Commit

Permalink
Fix warnings in stubbed out set_times
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtriplett committed Jul 30, 2022
1 parent 11d9be6 commit f8061dd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions library/std/src/sys/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1071,10 +1071,11 @@ impl File {
cfg_if::cfg_if! {
if #[cfg(target_os = "redox")] {
// Redox doesn't appear to support `UTIME_OMIT`.
return Err(io::const_io_error!(
drop(times);
Err(io::const_io_error!(
io::ErrorKind::Unsupported,
"setting file times not supported",
));
))
} else if #[cfg(any(target_os = "android", target_os = "macos"))] {
// futimens requires macOS 10.13, and Android API level 19
cvt(unsafe {
Expand All @@ -1100,12 +1101,12 @@ impl File {
)),
}
})?;
Ok(())
} else {
cvt(unsafe { libc::futimens(self.as_raw_fd(), times.0.as_ptr()) })?;
Ok(())
}
}

Ok(())
}
}

Expand Down

0 comments on commit f8061dd

Please sign in to comment.