runtime-rs: Log error instead of format

Log on error condition when `umount` operation fail instead of `format!`
error message.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
Ruoqing He
2025-06-05 02:42:03 +00:00
parent 17b2daf0a7
commit 781510202a

View File

@@ -105,8 +105,8 @@ impl SandboxBindMounts {
mount::bind_mount_unchecked(Path::new(bindmount), &mount_dest, true, MsFlags::MS_SLAVE)
.map_err(|e| {
for p in &mounted_list {
nix::mount::umount(p).unwrap_or_else(|x| {
format!("do umount failed: {:?}", x);
nix::mount::umount(p).unwrap_or_else(|e| {
error!(sl!(), "do umount failed: {:?}", e);
});
}
e