[Dovecot] 1.0-test75 and roadmap for v1.0

Timo Sirainen tss at iki.fi
Tue Jul 12 19:28:18 EEST 2005


On Tue, 2005-07-12 at 16:07 +0100, Dominic Marks wrote:
> > > io_loop_handle_remove() should always be called before close(), so
> > > kevent() should never fail. What am I missing?
> 
> Seems to be the other way around, since I can work around the
> warning by using fstat to check if the descriptor is in use. I
> currently have this:
> 
> if (kevent(data->kq, &data->event, 1, NULL, 0, NULL) < 0) {
> 	if (fstat(fd, NULL) == 0) {
> 	 /*
>           * Trying to remove filters on a closed descriptor
>           * will cause kevent(2) to return an error. If we
>           * sure that descriptors are ALWAYS closed before
>           * this function we can delete the entire function
>           * body.
>           */
>         	i_warning("couldn't remove filter on fd %d with kqueue: %m", fd);
>         }

Uhm. I think Dovecot's code should rather be fixed so the function
doesn't get called with closed file descriptors. I'm not sure if it's
possible everywhere without larger changes though..

Anyway I don't think you should add the extra fstat() there, not giving
a warning if EBADF error comes is just as good without extra syscall.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://dovecot.org/pipermail/dovecot/attachments/20050712/5ed96599/attachment-0001.bin>


More information about the dovecot mailing list