ksud: dummy mount stdout and stderr

This commit is contained in:
tiann
2023-01-24 15:06:50 +08:00
parent b4bc2e66e6
commit 1475a85c58

View File

@@ -8,7 +8,10 @@ use retry::delay::NoDelay;
use subprocess::Exec; use subprocess::Exec;
fn do_mount_image(src: &str, target: &str) -> Result<()> { fn do_mount_image(src: &str, target: &str) -> Result<()> {
let result = Exec::shell(format!("mount -t ext4 {} {}", src, target)).join()?; let result = Exec::shell(format!("mount -t ext4 {} {}", src, target))
.stdout(subprocess::NullFile)
.stderr(subprocess::Redirection::Merge)
.join()?;
ensure!(result.success(), "do mount: {} -> {} failed.", src, target); ensure!(result.success(), "do mount: {} -> {} failed.", src, target);
Ok(()) Ok(())
} }
@@ -57,4 +60,4 @@ pub fn get_zip_uncompressed_size(zip_path: &str) -> Result<u64> {
.map(|i| zip.by_index(i).unwrap().size()) .map(|i| zip.by_index(i).unwrap().size())
.sum(); .sum();
Ok(total) Ok(total)
} }