From: Stephen Hemminger Date: Wed, 15 Jul 2015 17:16:16 +0000 (-0700) Subject: eal/linux: handle signal on event read X-Git-Tag: spdx-start~8676 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7ccfcb159313ce40bc57de2eecc3067eee493131;p=dpdk.git eal/linux: handle signal on event read The read for events in the interrupt thread may get interrupted by signals from application. Avoid generating stray log message. Signed-off-by: Stephen Hemminger --- diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c index b5f369ea1b..61e7c856b6 100644 --- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c +++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c @@ -720,12 +720,14 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds) * for epoll_wait. */ bytes_read = read(events[n].data.fd, &buf, bytes_read); + if (bytes_read < 0) { + if (errno == EINTR || errno == EWOULDBLOCK) + continue; - if (bytes_read < 0) RTE_LOG(ERR, EAL, "Error reading from file " "descriptor %d: %s\n", events[n].data.fd, strerror(errno)); - else if (bytes_read == 0) + } else if (bytes_read == 0) RTE_LOG(ERR, EAL, "Read nothing from file " "descriptor %d\n", events[n].data.fd);