From: sgunderson@bigfoot.com <> Date: Tue, 13 Feb 2007 22:59:34 +0000 (+0100) Subject: EINTR, not EAGAIN. X-Git-Url: https://git.sesse.net/?p=jam;a=commitdiff_plain;h=HEAD EINTR, not EAGAIN. --- 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 {