Add EWOULDBLOCK error handling 30/91530/1 accepted/tizen/3.0/ivi/20161028.123121 accepted/tizen/3.0/mobile/20161028.122444 accepted/tizen/3.0/tv/20161028.122656 accepted/tizen/3.0/wearable/20161028.122916 accepted/tizen/common/20161010.145845 accepted/tizen/ivi/20161010.083243 accepted/tizen/mobile/20161010.083152 accepted/tizen/tv/20161010.083211 accepted/tizen/wearable/20161010.083225 submit/tizen/20161010.043049 submit/tizen_3.0/20161028.062323 submit/tizen_3.0/20161028.082323 submit/tizen_3.0_common/20161104.104000
authorHyunho Kang <hhstark.kang@samsung.com>
Mon, 10 Oct 2016 05:49:43 +0000 (14:49 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Mon, 10 Oct 2016 05:51:20 +0000 (14:51 +0900)
- wrt(nodejs) can change socket to none-blocking mode

Change-Id: I0a6d19c4593e14a27e3d60974d27cd418a5061e8
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
src/data-control-internal.c

index fbecd5c415fab46cc1e3f4ac103b209cfc681b2e..50b5100d394a2b0ae0da1d36143747ddcb35795c 100755 (executable)
@@ -408,7 +408,8 @@ int _read_socket(int fd, char *buffer, unsigned int nbytes,
                        LOGE("_read_socket: ...read EOF, socket closed %d: nb %d\n", fd, nb);
                        return DATACONTROL_ERROR_IO_ERROR;
                } else if (nb == -1) {
-                       if (errno == EINTR || errno == EAGAIN) {
+                       /* wrt(nodejs) could change socket to none-blocking socket :-( */
+                       if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) {
                                LOGE("_read_socket: %d errno, sleep and retry ...", errno);
                                retry_cnt++;
                                nanosleep(&TRY_SLEEP_TIME, 0);