From 2069742fbd086c6a9f19951f5a520e2263b8d4f1 Mon Sep 17 00:00:00 2001 From: ilho kim Date: Wed, 4 Jan 2023 09:20:55 +0900 Subject: [PATCH] Check if it is mounted before trying mount Due to abnormal termination, the previously mounted path may remain Change-Id: I20e25de24deae8a4a11e7da506eb8dfb830b0794 Signed-off-by: ilho kim --- src/common/tzip_interface.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/tzip_interface.cc b/src/common/tzip_interface.cc index 0ce658e..f215674 100644 --- a/src/common/tzip_interface.cc +++ b/src/common/tzip_interface.cc @@ -94,6 +94,12 @@ class TzipInterface::Pimpl { bool MountZip(const boost::filesystem::path& zip_path) { zip_path_ = zip_path; + if (IsMounted()) { + LOG(WARNING) << "Mount path(" << mount_path_ + << ") already mounted, try to unmount"; + UnmountZip(); + } + if (bf::exists(mount_path_)) { LOG(WARNING) << "Mount path(" << mount_path_ << ") already exists! " << "We will remove it..."; -- 2.7.4