Handle EINTR error
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 12:06:56 +0000 (21:06 +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 9280782d27f223ff21a80f07f0f3f5df706d382f..131984802c9aea8b0808772e5e7e87b5152c6a9b 100644 (file)
@@ -109,6 +109,11 @@ int ClientSocket::Receive(void* buf, unsigned int size) {
       return -EIO;
     }
 
+    if (errno == EINTR) {
+      usleep(100 * 1000);
+      continue;
+    }
+
     if (bytes < 0)
       return -errno;