[dpdk-dev] [PATCH 3/3] rte_epoll_wait: allow EINTR to be passed to caller

Matthew Hall mhall at mhcomputing.net
Sat Feb 13 22:38:44 CET 2016


Otherwise the caller will not be able to handle a return from a signal
handler.

Signed-off-by: Matthew Hall <mhall at mhcomputing.net>
---
 lib/librte_eal/linuxapp/eal/eal_interrupts.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
index c999cb6..4806ed1 100644
--- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c
+++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
@@ -1047,8 +1047,10 @@ rte_epoll_wait(int epfd, struct rte_epoll_event *events,
 			rc = eal_epoll_process_event(evs, rc, events);
 			break;
 		} else if (rc < 0) {
-			if (errno == EINTR)
-				continue;
+			if (errno == EINTR) {
+				/* timeout early (such as thread shutdown) */
+				break;
+			}
 			/* epoll_wait fail */
 			RTE_LOG(ERR, EAL, "epoll_wait returns with fail %s\n",
 				strerror(errno));
-- 
2.5.0



More information about the dev mailing list