# arch-tag: automatic-ChangeLog--srvx@srvx.net--2006/srvx--devo--1.3
#
+2007-01-08 04:27:45 GMT Michael Poole <mdpoole@troilus.org> patch-81
+
+ Summary:
+ Avoid epoll_ctl(..., EPOLL_CTL_DEL, ...) for closed fds.
+ Revision:
+ srvx--devo--1.3--patch-81
+
+ src/ioset-impl.h (struct io_engine): Add "os_closed" parameter to
+ remove() method.
+
+ src/ioset.c (ioset_close): Add this to the call.
+
+ src/ioset-epoll.c (ioset_epoll_remove): Use it to avoid removing the fd
+ from epoll_fd, since that epoll_ctl() call will always fail.
+
+ src/ioset-select.c (ioset_select_remove): Ignore the new parameter.
+
+ modified files:
+ ChangeLog src/ioset-epoll.c src/ioset-impl.h
+ src/ioset-select.c src/ioset.c
+
+
2007-01-08 04:22:20 GMT Michael Poole <mdpoole@troilus.org> patch-80
Summary:
}
static void
-ioset_epoll_remove(struct io_fd *fd)
+ioset_epoll_remove(struct io_fd *fd, int closed)
{
static struct epoll_event evt;
- (void)epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd->fd, &evt);
+ if (!closed)
+ (void)epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd->fd, &evt);
}
static void
const char *name;
int (*init)(void);
void (*add)(struct io_fd *fd);
- void (*remove)(struct io_fd *fd);
+ void (*remove)(struct io_fd *fd, int os_closed);
void (*update)(struct io_fd *fd);
int (*loop)(struct timeval *timeout);
void (*cleanup)(void);
}
static void
-ioset_select_remove(struct io_fd *fd)
+ioset_select_remove(struct io_fd *fd, int closed)
{
FD_CLR(fd->fd, &read_fds);
FD_CLR(fd->fd, &write_fds);
+ (void)closed;
}
static void
free(fdp->recv.buf);
if (os_close & 1)
close(fdp->fd);
- engine->remove(fdp);
+ engine->remove(fdp, os_close & 1);
free(fdp);
}