Check directory existence before calling mount 33/317233/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 6 Sep 2024 05:29:02 +0000 (14:29 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 6 Sep 2024 05:29:02 +0000 (14:29 +0900)
If the destination directory does not exist, we should skip to call
mount() function. This patch is to reduce printing error logs.

Change-Id: I3d05e303a1940ee88345465399e2280f0a7caafe
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/launchpad-glib/util.cc

index a36e12eb0608c14d0e76e4b9b4ee58716d978df1..3545bf8e3885280f5184636db3692efee3bdeade 100644 (file)
@@ -259,6 +259,8 @@ class TepMountChecker : public DBus {
 
 int MountDirectories(const std::vector<std::string>& srcs,
     const std::string& dest) {
+  if (access(dest.c_str(), F_OK) != 0) return 0;
+
   std::string opt = "lowerdir=";
   for (auto& src : srcs)
     opt += src + ":";