From 70d2866cb2a0c4f55f13ad32d68a4221c8c3e89c Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Tue, 13 Feb 2007 23:59:34 +0100 Subject: [PATCH] EINTR, not EAGAIN. --- jam.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jam.c b/jam.c index a8cef5a..9eab9c9 100644 --- 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 { -- 2.39.2