correct the retry condition of poll() 55/77655/1
authorBoram Park <boram1288.park@samsung.com>
Wed, 22 Jun 2016 04:15:39 +0000 (13:15 +0900)
committerBoram Park <boram1288.park@samsung.com>
Thu, 30 Jun 2016 10:52:15 +0000 (19:52 +0900)
Change-Id: I7b2cdd80ccc903811ed791dead112932b887469b

client/tdm_client.h
src/tdm_display.c
src/tdm_thread.c
tools/tdm_test_client.c

index a6a7a09..fff8808 100644 (file)
@@ -113,7 +113,7 @@ tdm_client_destroy(tdm_client *client);
  * while(1) {
  *    ret = poll(&fds, 1, -1);
  *    if (ret < 0) {
- *       if (errno == EBUSY)
+ *       if (errno == EINTR || errno == EAGAIN)
  *          continue;
  *       else {
  *          //error handling
index 17c02aa..cab04a6 100644 (file)
@@ -417,7 +417,7 @@ tdm_display_handle_events(tdm_display *dpy)
                TDM_INFO("fd(%d) polling in", fd);
 
        while (poll(&fds, 1, -1) < 0) {
-               if (errno == EBUSY)  /* normal case */
+               if (errno == EINTR || errno == EAGAIN)  /* normal case */
                        continue;
                else {
                        TDM_ERR("poll failed: %m");
index 0d24561..3ae6d0b 100644 (file)
@@ -99,7 +99,7 @@ _tdm_thread_main(void *data)
                        TDM_INFO("fd(%d) polling out", fd);
 
                if (ret < 0) {
-                       if (errno == EBUSY)  /* normal case */
+                       if (errno == EINTR || errno == EAGAIN)  /* normal case */
                                continue;
                        else {
                                TDM_ERR("poll failed: %m");
index 499d1f5..7268628 100644 (file)
@@ -121,7 +121,7 @@ main(int argc, char *argv[])
                if (!sync) {
                        ret = poll(&fds, 1, -1);
                        if (ret < 0) {
-                               if (errno == EBUSY)  /* normal case */
+                               if (errno == EINTR || errno == EAGAIN)  /* normal case */
                                        continue;
                                else {
                                        printf("poll failed: %m\n");