Handle EINTR error 93/309493/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 11 Apr 2024 10:40:02 +0000 (19:40 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 11 Apr 2024 10:40:02 +0000 (19:40 +0900)
Currently, the socket mode is blocking. We should handle EINTR error to
receive the data properly.

Change-Id: Icec0439bf547401b72575d05da513711513f4b54
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/client-socket-internal.cc

index 08b2ae9..241e52d 100644 (file)
@@ -115,6 +115,11 @@ int ClientSocket::Receive(void* buf, unsigned int size) {
       return -EIO;  // LCOV_EXCL_STOP
     }
 
+    if (errno == EINTR) {
+      usleep(100 * 1000);
+      continue;
+    }
+
     if (bytes < 0)
       return -errno;  // LCOV_EXCL_LINE