Check EPIPE error
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 20 Apr 2022 05:30:10 +0000 (14:30 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 20 Apr 2022 06:09:12 +0000 (15:09 +0900)
If the error value is EPIPE, AMD doesn't close the socket connection.
Because, the EPIPE error means "Broken pipe".
The server closes the socket connection.

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

index e6bab23..7e3558e 100644 (file)
@@ -300,7 +300,12 @@ extern "C" EXPORT_API int amd_app_request_broker_send(
   auto raw = parcel.GetRaw();
   int ret = channel->Send(reinterpret_cast<void*>(&raw[0]), raw.size());
   if (ret != 0) {
-    _E("Socket will be closed, pid(%d)", channel->GetPid());
+    if (ret == -EPIPE) {
+      _E("Socket was closed. pid(%d)", channel->GetPid());
+      return ret;
+    }
+
+    _E("Socket will be closed. pid(%d)", channel->GetPid());
     channel->Close();
     return ret;
   }