[Dovecot] 1.0.beta2 released

Timo Sirainen tss at iki.fi
Sun Jan 29 12:16:28 EET 2006


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?

Also can't the above just as well be written as:

if ((fds[fd].mode & (IO_READ | IO_ERROR)) == 0)
	if (kevent(ctx->kq, &ev, 1, NULL, 0, NULL) == -1 && errno != EBADF) {

> The other attached patch is what I used for easier debugging. I think it 
> could help somebody else too.

I've tried to keep the error messages as unique as needed so that file
names and numbers wouldn't be needed :) But I'll add it to
http://dovecot.org/patches/ in case it's needed some day by someone.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20060129/a6b88ce2/attachment.pgp


More information about the dovecot mailing list