From ee90ba719ca9dfe34a3bc2fc58a9ba93a0d95ab9 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Wed, 22 Jun 2016 13:15:39 +0900 Subject: [PATCH] correct the retry condition of poll() Change-Id: I7b2cdd80ccc903811ed791dead112932b887469b --- client/tdm_client.h | 2 +- src/tdm_display.c | 2 +- src/tdm_thread.c | 2 +- tools/tdm_test_client.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/tdm_client.h b/client/tdm_client.h index a6a7a09..fff8808 100644 --- a/client/tdm_client.h +++ b/client/tdm_client.h @@ -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 diff --git a/src/tdm_display.c b/src/tdm_display.c index 17c02aa..cab04a6 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -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"); diff --git a/src/tdm_thread.c b/src/tdm_thread.c index 0d24561..3ae6d0b 100644 --- a/src/tdm_thread.c +++ b/src/tdm_thread.c @@ -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"); diff --git a/tools/tdm_test_client.c b/tools/tdm_test_client.c index 499d1f5..7268628 100644 --- a/tools/tdm_test_client.c +++ b/tools/tdm_test_client.c @@ -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"); -- 2.7.4