Check if it is mounted before trying mount
[platform/core/appfw/app-installers.git] / src / common / tzip_interface.cc
index 0ce658e..f215674 100644 (file)
@@ -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...";