From 3497145f8c5c09f509006edc006ef6d4609c6519 Mon Sep 17 00:00:00 2001 From: ilho kim Date: Tue, 3 Jan 2023 11:13:30 +0900 Subject: [PATCH] Skip mount if zip path doesn't exist Mount operation fails when there is no zip path so trying mount is useless operation Change-Id: I5f9a556b2a770b61a63cffb49cfd491a71670dd7 Signed-off-by: ilho kim --- src/common/tzip_interface.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/tzip_interface.cc b/src/common/tzip_interface.cc index e35e304..26fabf2 100644 --- a/src/common/tzip_interface.cc +++ b/src/common/tzip_interface.cc @@ -100,6 +100,11 @@ class TzipInterface::Pimpl { bf::remove(mount_path_); } + if (!bf::exists(zip_path)) { + LOG(WARNING) << "zip path(" << zip_path << ") doesn't exist!"; + return false; + } + const char* mount_path_str = mount_path_.string().c_str(); const char* zip_path_str = zip_path_.string().c_str(); const char* tzip_smack_rule = kTzipSmackRule; -- 2.7.4