From: Ilho Kim Date: Fri, 19 Apr 2024 05:14:36 +0000 (+0900) Subject: Fix Receive X-Git-Tag: accepted/tizen/8.0/unified/20240419.170015~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F310007%2F1;p=platform%2Fcore%2Fappfw%2Frpc-port.git Fix Receive After returning the EINTR in the first read, even if the read is successful it regarded as the EINTR case and continue loop Change-Id: Ia7cfa4cf60c7131b63d5a782ebf5e2b719e3c6c5 Signed-off-by: Ilho Kim (cherry picked from commit d83c74a93e1c5f77da5a8b3ecd735629af42ccf3) --- diff --git a/src/client-socket-internal.cc b/src/client-socket-internal.cc index 241e52d..9a71b4e 100644 --- a/src/client-socket-internal.cc +++ b/src/client-socket-internal.cc @@ -115,13 +115,14 @@ int ClientSocket::Receive(void* buf, unsigned int size) { return -EIO; // LCOV_EXCL_STOP } - if (errno == EINTR) { - usleep(100 * 1000); - continue; - } + if (bytes < 0) { + if (errno == EINTR) { + usleep(100 * 1000); + continue; + } - if (bytes < 0) return -errno; // LCOV_EXCL_LINE + } len -= bytes; buffer += bytes;