Add restart loader condition 90/301590/2
authorChanggyu Choi <changyu.choi@samsung.com>
Mon, 20 Nov 2023 08:36:26 +0000 (17:36 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Tue, 21 Nov 2023 01:29:20 +0000 (01:29 +0000)
When handling the RESTART_LOADER command, it is necessary to check whether the
loader_context is launchable.
In some cases, a problem occurred by launching a loader in a non-executable state.
This patch fixes this case.

Change-Id: I835799364d4dcd4e0d8c30e0d60a52f5ec08ff10
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/launchpad-process-pool/launchpad.cc

index bfbe8ad..1562f15 100644 (file)
@@ -606,7 +606,7 @@ void Launchpad::HandleRestartLoaderRequest(std::shared_ptr<Request> request) {
   if (loader_context->RefCount() == 0)
     loader_context->Dispose();
 
-  if (loader_context->GetPid() < 1)
+  if (loader_context->GetPid() < 1 && loader_context->IsLaunchable())
     loader_context->Prepare();
 
   _W("[PAD_CMD_RESTART_LOADER] loader_name: %s, pid: %d",