Fix file name issue on checking launchpad socket 77/318477/2
authorJihoi Kim <jihoi.kim@samsung.com>
Fri, 17 Jan 2025 07:14:51 +0000 (16:14 +0900)
committerJihoi Kim <jihoi.kim@samsung.com>
Fri, 17 Jan 2025 07:56:38 +0000 (16:56 +0900)
- Previous patch change filename which shows launchpad socket is ready
- This patch fix aul apis to access via new filename
- Change variable names to distinguish socket ready file and socket itself

Change-Id: Ie82a5c50fe04501010ac3e8e453fed2d00b7f4d1
Signed-off-by: Jihoi Kim <jihoi.kim@samsung.com>
src/aul/launch.cc

index 5982980bf09279e6d9793128992a601c414ae5bd..044f5dd4f1cf7ba8c862ae276a66e70b56b81b27 100644 (file)
@@ -56,6 +56,8 @@ namespace {
 constexpr const char kRunAulDaemonsPath[] = "/run/aul/daemons/";
 constexpr const char kLaunchpadProcessPoolSock[] =
     "@org.tizen.appfw.launchpad-process-pool";
+constexpr const char kLaunchpadProcessPoolSockReady[] =
+    ".launchpad-process-pool-sock";
 const int kPadCmdKillLoader = 19;
 const int kPadCmdRestartLoader = 20;
 constexpr const int TEP_ISMOUNT_MAX_RETRY_CNT = 20;
@@ -1039,9 +1041,9 @@ extern "C" API int aul_kill_loader_for_uid(const char* loader_name,
   }
 
   //TODO(Abstract Socket Issue): file-based socket check
-  std::string endpoint = kRunAulDaemonsPath + std::to_string(uid) + "/" +
-                         std::string(kLaunchpadProcessPoolSock);
-  if (!std::filesystem::exists(endpoint)) {
+  std::string sock_ready = kRunAulDaemonsPath + std::to_string(uid) + "/" +
+      std::string(kLaunchpadProcessPoolSockReady);
+  if (access(sock_ready.c_str(), F_OK) != 0) {
     _E("launchpad socket is not prepared");
     return AUL_R_ENOENT;
   }
@@ -1078,9 +1080,9 @@ extern "C" API int aul_restart_loader_for_uid(const char* loader_name,
   }
 
   //TODO(Abstract Socket Issue): file-based socket check
-  std::string endpoint = kRunAulDaemonsPath + std::to_string(uid) + "/" +
-                         std::string(kLaunchpadProcessPoolSock);
-  if (!std::filesystem::exists(endpoint)) {
+  std::string sock_ready = kRunAulDaemonsPath + std::to_string(uid) + "/" +
+      std::string(kLaunchpadProcessPoolSockReady);
+  if (access(sock_ready.c_str(), F_OK) != 0) {
     _E("launchpad socket is not prepared");
     return AUL_R_ENOENT;
   }