debug: guest_server sleep
authorJinhyung Choi <jinhyung2.choi@samsung.com>
Wed, 25 Jun 2014 09:53:46 +0000 (18:53 +0900)
committerJinhyung Choi <jinhyung2.choi@samsung.com>
Wed, 25 Jun 2014 09:53:46 +0000 (18:53 +0900)
Change-Id: I5587542fbaa131cbf75761b325bccf3baea2a790
Signed-off-by: Jinhyung Choi <jinhyung2.choi@samsung.com>
tizen/src/guest_server.c

index bf2d5d526c1a16ab1a3a930bad83550a3344729b..be9122b95c117072ff46d5ce4bc849094ce0cf17 100644 (file)
@@ -523,8 +523,13 @@ static void server_process(void)
                             (struct sockaddr*) &client_addr, &client_len);
 
         if (read_cnt < 0) {
-            if (errno == EAGAIN)
+            if (errno == EAGAIN || errno == EWOULDBLOCK) {
+#ifdef _WIN32
+                Sleep(2);
+#else
+                usleep(2000);
                 continue;
+            }
             INFO("fail to recvfrom in guest_server:%d\n", errno);
             break;
         } else if (read_cnt == 0) {
@@ -538,11 +543,6 @@ static void server_process(void)
 
         command_handler(readbuf, &client_addr);
 
-#ifdef _WIN32
-        Sleep(2);
-#else
-        usleep(2000);
-#endif
     }
 }