There were cases that we we were mishandling where D-BUS would try to send us the same file descriptor when changing events. Instead of trying to blindly add a new event (which caused an EEXIST error in epoll), we will remove the old tevent_fd and add the new one.
Also, we were trying to be too fancy in the toggle function. It is simpler to just remove or add watches as appropriate.
On Wed, 2009-08-26 at 15:51 -0400, Stephen Gallagher wrote:
There were cases that we we were mishandling where D-BUS would try to send us the same file descriptor when changing events. Instead of trying to blindly add a new event (which caused an EEXIST error in epoll), we will remove the old tevent_fd and add the new one.
Nice catch.
Also, we were trying to be too fancy in the toggle function. It is simpler to just remove or add watches as appropriate.
Nack, it's a waste of resources to remove and re-add watches, you aend up freeing and allocating memory for no good reason, please leave the toggle function and instead treat an add of an existing watch as a simple toggle.
Simo.
sssd-devel@lists.fedorahosted.org