Check the return value of the launcher
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 23 Dec 2021 09:10:58 +0000 (18:10 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 23 Dec 2021 09:15:21 +0000 (18:15 +0900)
If the error value is not -ECOMM, AMD should not increase failure count.

Change-Id: Ie63d8bb889cade92ea0b66dc54d1c948a11aecb8
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/amd_launchpad.cc

index f5c418514bc5524e3cadf434b00a1984282c4115..f5bf88f3f9fe1a3f87ff34af2076264f56ff210d 100644 (file)
@@ -182,7 +182,7 @@ class Launchpad : public ClientChannel::IEvent {
     int ret = cb_(kb, uid, user_data_);
     if (ret < 0) {
       _E("Launch() is failed. error(%d)", ret);
-      if (channel.get() != nullptr)
+      if (ret == -ECOMM && channel.get() != nullptr)
         channel->IncreaseFailureCount();
     } else {
       if (channel.get() != nullptr)
@@ -275,17 +275,17 @@ int DefaultLauncher(bundle* request, uid_t uid, void* user_data) {
     int ret = client->Send(reinterpret_cast<void*>(&raw[0]), raw.size());
     if (ret != 0) {
       _E("Send() is failed. error(%d)", ret);
-      return ret;
+      return -ECOMM;
     }
 
     ret = client->Receive(reinterpret_cast<void*>(&result), sizeof(result));
     if (ret != 0) {
       _E("Receive() is failed. error(%d)", ret);
-      return ret;
+      return -ECOMM;
     }
   } catch (const Exception& e) {
     _E("Exception occurs. error(%s)", e.what());
-    return e.GetErrorCode();
+    return -ECOMM;
   }
 
   return result;