From: Hwankyu Jhun Date: Thu, 11 Apr 2024 10:40:02 +0000 (+0900) Subject: Handle EINTR error X-Git-Tag: accepted/tizen/8.0/unified/20240412.063035~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F309493%2F1;p=platform%2Fcore%2Fappfw%2Frpc-port.git Handle EINTR error Currently, the socket mode is blocking. We should handle EINTR error to receive the data properly. Change-Id: Icec0439bf547401b72575d05da513711513f4b54 Signed-off-by: Hwankyu Jhun --- diff --git a/src/client-socket-internal.cc b/src/client-socket-internal.cc index 08b2ae9..241e52d 100644 --- a/src/client-socket-internal.cc +++ b/src/client-socket-internal.cc @@ -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