eal/linux: handle signal on event read
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal_interrupts.c
index 3a84b3c..61e7c85 100644 (file)
@@ -505,7 +505,7 @@ rte_intr_callback_register(struct rte_intr_handle *intr_handle,
                if (write(intr_pipe.writefd, "1", 1) < 0)
                        return -EPIPE;
 
-       return (ret);
+       return ret;
 }
 
 int
@@ -569,7 +569,7 @@ rte_intr_callback_unregister(struct rte_intr_handle *intr_handle,
                ret = -EPIPE;
        }
 
-       return (ret);
+       return ret;
 }
 
 int
@@ -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);
 
@@ -894,4 +896,3 @@ rte_eal_intr_init(void)
 
        return -ret;
 }
-