ksud: copy when rename failed
This commit is contained in:
@@ -531,6 +531,8 @@ fn do_install_module(zip: String) -> Result<()> {
|
||||
|
||||
// all done, rename the tmp image to modules_update.img
|
||||
if std::fs::rename(tmp_module_img, defs::MODULE_UPDATE_IMG).is_err() {
|
||||
std::fs::copy(tmp_module_img, defs::MODULE_UPDATE_IMG)
|
||||
.with_context(|| "Failed to copy image.".to_string())?;
|
||||
let _ = std::fs::remove_file(tmp_module_img);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ pub fn mount_overlay(lowerdir: &str, mnt: &str) -> Result<()> {
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "android"))]
|
||||
pub fn mount_ext4(_src: &str, _target: &str, autodrop: bool) -> Result<()> {
|
||||
pub fn mount_ext4(_src: &str, _target: &str, _autodrop: bool) -> Result<()> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user