On Sun, 2006-01-29 at 12:16 +0200, Timo Sirainen wrote:
On Mon, 2006-01-23 at 18:50 +0100, Vaclav Haisman wrote:
I have attached patch that should fix all kqueue issues (I hope). It is smaller than it looks because I also reindented both kqueue files with tabs as is the rest of the source.
if ((fds[fd].mode & (IO_READ | IO_ERROR)) == 0 && (fcntl(io->fd, F_GETFD, 0) != -1 || errno != EBADF)) if (kevent(ctx->kq, &ev, 1, NULL, 0, NULL) == -1) {
Can't this be fixed some other way so that those EBADFs don't happen? If not, is it guaranteed that it gives EBADF, and not accidentally succeed because some other fd was just opened with same number as io->fd?
I committed this now without these EBADF checks and removed some other things that seemed to be there only for debugging and slowing down normal use.
Until I'm sure the EBADF checks are right, I think it's better to show errors caused by them than potentially cause random hidden problems.