Handle broken utimes() on Android
Closes https://github.com/ankidroid/Anki-Android/issues/12827 Closes https://github.com/ankidroid/Anki-Android/issues/12974
This commit is contained in:
parent
272d53079f
commit
4c5a2461d0
@ -349,7 +349,13 @@ where
|
||||
.duration_since(time::UNIX_EPOCH)
|
||||
.unwrap()
|
||||
.as_secs() as i64;
|
||||
utime::set_file_times(&dst_path, secs, secs)?;
|
||||
if let Err(err) = utime::set_file_times(&dst_path, secs, secs) {
|
||||
// The libc utimes() call fails on (some? all?) Android devices. Since we don't
|
||||
// do automatic expiry yet, we can safely ignore the error.
|
||||
if !cfg!(target_os = "android") {
|
||||
return Err(err.into());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user