Skip to content

Commit c50c45f

Browse files
authored
Rollup merge of rust-lang#100249 - Meziu:master, r=joshtriplett
Fix HorizonOS regression in FileTimes The changes in rust-lang#98246 caused a regression for multiple Newlib-based systems. This is just a fix including HorizonOS to the list of targets which require a workaround. `@AzureMarker` `@ian-h-chamberlain` r? `@nagisa`
2 parents d3d2730 + 926f587 commit c50c45f

File tree

1 file changed

+5
-5
lines changed
  • library/std/src/sys/unix

1 file changed

+5
-5
lines changed

library/std/src/sys/unix/fs.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,11 @@ impl Default for FileTimes {
544544
fn default() -> Self {
545545
// Redox doesn't appear to support `UTIME_OMIT`, so we stub it out here, and always return
546546
// an error in `set_times`.
547-
// ESP-IDF does not support `futimens` at all and the behavior for that OS is therefore
547+
// ESP-IDF and HorizonOS do not support `futimens` at all and the behavior for those OS is therefore
548548
// the same as for Redox.
549-
#[cfg(any(target_os = "redox", target_os = "espidf"))]
549+
#[cfg(any(target_os = "redox", target_os = "espidf", target_os = "horizon"))]
550550
let omit = libc::timespec { tv_sec: 0, tv_nsec: 0 };
551-
#[cfg(not(any(target_os = "redox", target_os = "espidf")))]
551+
#[cfg(not(any(target_os = "redox", target_os = "espidf", target_os = "horizon")))]
552552
let omit = libc::timespec { tv_sec: 0, tv_nsec: libc::UTIME_OMIT as _ };
553553
Self([omit; 2])
554554
}
@@ -1083,9 +1083,9 @@ impl File {
10831083

10841084
pub fn set_times(&self, times: FileTimes) -> io::Result<()> {
10851085
cfg_if::cfg_if! {
1086-
if #[cfg(any(target_os = "redox", target_os = "espidf"))] {
1086+
if #[cfg(any(target_os = "redox", target_os = "espidf", target_os = "horizon"))] {
10871087
// Redox doesn't appear to support `UTIME_OMIT`.
1088-
// ESP-IDF does not support `futimens` at all and the behavior for that OS is therefore
1088+
// ESP-IDF and HorizonOS do not support `futimens` at all and the behavior for those OS is therefore
10891089
// the same as for Redox.
10901090
drop(times);
10911091
Err(io::const_io_error!(

0 commit comments

Comments
 (0)