Skip to content

Commit 73132a9

Browse files
committed
[EXPERIMENTAL] what failed on loongarch
1 parent be4b56f commit 73132a9

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/bootstrap/src/utils/helpers.rs

+15-2
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,19 @@ pub fn get_closest_merge_base_commit(
547547

548548
/// Sets the file times for a given file at `path`.
549549
pub fn set_file_times<P: AsRef<Path>>(path: P, times: fs::FileTimes) -> io::Result<()> {
550-
let f = fs::File::options().write(true).open(path)?;
551-
f.set_times(times)
550+
let path = path.as_ref();
551+
let f = match fs::File::options().write(true).open(&path) {
552+
Ok(fd) => fd,
553+
Err(e) => {
554+
eprintln!("could not open {} as writable file", path.display());
555+
panic!("{e}");
556+
}
557+
};
558+
match f.set_times(times) {
559+
Ok(()) => Ok(()),
560+
Err(e) => {
561+
eprintln!("could not set file times for {}", path.display());
562+
panic!("{e}");
563+
}
564+
}
552565
}

0 commit comments

Comments
 (0)