[Dovecot] Apple patches 1-5

Timo Sirainen tss at iki.fi
Tue Dec 16 05:21:26 EET 2008


On Tue, 2008-12-16 at 05:01 +0200, Timo Sirainen wrote:
> > Patch #3.  Some versions of Mac OS X return near-duplicate kevents.
> 
> This probably won't affect other BSDs, so I think the duplicate removal
> should be around #ifdef __APPLE__?

Hmm. Actually I think when I was writing that code I noticed the same
thing and tried to fix it with:

		/* there can be multiple events for a single io.
		   call the callback only once if that happens. */
		if (io->refcount == 2 && io->io.callback != NULL)
			io->io.callback(io->io.context);

But later (although inside the same commit..) I probably added the
assert to:

	for (i = 0; i < ret; i++) {
		io = (void *)events[i].udata;
		i_assert(io->refcount == 1);
		io->refcount++;
	}

Which makes the refcount == 2 check pointless. I think it would work
correctly simply if the assert was removed?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20081216/524c7f7a/attachment-0001.bin 


More information about the dovecot mailing list