From: sgunderson@bigfoot.com <> Date: Tue, 13 Feb 2007 22:17:53 +0000 (+0100) Subject: Minor epoll fixes. X-Git-Url: https://git.sesse.net/?p=jam;a=commitdiff_plain;h=bc98f29eed4e03c5dc9b78bf4978ec7d490a5521;hp=a5844b6a95d61ba003e9c0611d93031e4dbe467e Minor epoll fixes. --- diff --git a/jam.c b/jam.c index c1f9bb1..0141e5b 100644 --- a/jam.c +++ b/jam.c @@ -278,7 +278,7 @@ void *sender_worker(void *arg) if (s->bytes_left == 0) { if (epoll_ctl(ep_fd, EPOLL_CTL_DEL, s->fd, NULL) == -1) { - perror("EPOLL_CTL_ADD"); + perror("EPOLL_CTL_DEL"); exit(1); } close(s->fd); @@ -366,13 +366,11 @@ void *receiver_worker(void *arg) ret = read(sock, buf, 65536); if (ret == 0) { - close(sock); - if (epoll_ctl(ep_fd, EPOLL_CTL_DEL, sock, NULL) == -1) { - perror("EPOLL_CTL_ADD"); + perror("EPOLL_CTL_DEL"); exit(1); } - + close(sock); continue; }