Skip to content

Commit

Permalink
[EXPERIMENTAL] what failed on loongarch
Browse files Browse the repository at this point in the history
  • Loading branch information
jieyouxu committed Aug 12, 2024
1 parent be4b56f commit 73132a9
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/bootstrap/src/utils/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,19 @@ pub fn get_closest_merge_base_commit(

/// Sets the file times for a given file at `path`.
pub fn set_file_times<P: AsRef<Path>>(path: P, times: fs::FileTimes) -> io::Result<()> {
let f = fs::File::options().write(true).open(path)?;
f.set_times(times)
let path = path.as_ref();
let f = match fs::File::options().write(true).open(&path) {
Ok(fd) => fd,
Err(e) => {
eprintln!("could not open {} as writable file", path.display());
panic!("{e}");
}
};
match f.set_times(times) {
Ok(()) => Ok(()),
Err(e) => {
eprintln!("could not set file times for {}", path.display());
panic!("{e}");
}
}
}

0 comments on commit 73132a9

Please sign in to comment.