We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be4b56f commit 73132a9Copy full SHA for 73132a9
src/bootstrap/src/utils/helpers.rs
@@ -547,6 +547,19 @@ pub fn get_closest_merge_base_commit(
547
548
/// Sets the file times for a given file at `path`.
549
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)
+ let path = path.as_ref();
+ 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
561
+ eprintln!("could not set file times for {}", path.display());
562
563
564
565
}
0 commit comments