]> git.sesse.net Git - jam/commitdiff
EINTR, not EAGAIN. master
authorsgunderson@bigfoot.com <>
Tue, 13 Feb 2007 22:59:34 +0000 (23:59 +0100)
committersgunderson@bigfoot.com <>
Tue, 13 Feb 2007 22:59:34 +0000 (23:59 +0100)
jam.c

diff --git a/jam.c b/jam.c
index a8cef5a725a45b586463b37ce5edd6b74f38e5c1..9eab9c9cfd57d7b0b63859e7c049f016e184e639 100644 (file)
--- a/jam.c
+++ b/jam.c
@@ -245,7 +245,7 @@ void *sender_worker(void *arg)
        for ( ;; ) {
                int num_active = epoll_wait(ep_fd, events, num_sockets_per_sender, -1);
                if (num_active == -1) {
-                       if (errno == EAGAIN)
+                       if (errno == EINTR)
                                continue;
                        perror("epoll_wait");
                        exit(1);
@@ -262,7 +262,7 @@ void *sender_worker(void *arg)
 
                        ret = send(s->fd, buf, bytes_to_send, MSG_NOSIGNAL);
                        if (ret == -1) {
-                               if (errno == EAGAIN)
+                               if (errno == EAGAIN || errno == EINTR)
                                        continue;
 
                                perror("send()");
@@ -336,7 +336,7 @@ void *receiver_worker(void *arg)
        for ( ;; ) {
                int num_active = epoll_wait(ep_fd, events, epoll_room_in_receiver, -1);
                if (num_active == -1) {
-                       if (errno == EAGAIN)
+                       if (errno == EINTR)
                                continue;
                        perror("epoll_wait");
                        exit(1);
@@ -352,7 +352,7 @@ void *receiver_worker(void *arg)
 
                                sock = accept(server_sock, (struct sockaddr *)&addr, &addr_len);
                                if (sock == -1) {
-                                       if (errno == EAGAIN) {
+                                       if (errno == EAGAIN || errno == EINTR) {
                                                // another thread snatched it, ignore
                                                continue;
                                        } else {