29 Jan
2006
29 Jan
'06
1:56 p.m.
On Sun, 2006-01-29 at 12:47 +0100, Václav Haisman wrote:
if ((fds[fd].mode & (IO_READ | IO_ERROR)) == 0) if (kevent(ctx->kq, &ev, 1, NULL, 0, NULL) == -1 && errno != EBADF) { The nature of kqueue is that it automatically removes/unregisters all filters associated with handle if the handle is closed and thus if the user of the ioloop code tries to remove the handle after it has been already closed then he gets EBADF.
In that case I think it'd be better to make sure io_remove() is always called before the file descriptor is closed. That way the real EBADF errors are catched, if there ever happened to be those for some reason. I'll start moving those io_remove()s..