On Thu, 2009-08-27 at 00:35 -0400, Simo Sorce wrote:
After some playing around with Stephen patch and adding some
debugging I
finally understood how DBUS likes to deal with watches.
We erroneously assumed that DBUS would add only one watch per FD.
It doesn't, instead it always adds 2 watches.
One to catch read events and one to catch write events.
It then proceed to always keep one of the 2 disabled when the other is
enabled, and it always toggles both when it needs to reverse access to
the file descriptor.
The following patch keeps track of sbus-watches/fd pairs and allocate
both DBusWatches to the same structure.
So far testing seem to confirm this approach works as expected.
New revision.
I was finally able to test this patch on an Ubuntu machine (thanks
Steve) and we found out 2 pretty nasty bugs masquerading each other on
Fedora.
This new revision should be final, it works on Ubuntu and on Fedora.
Simo.
--
Simo Sorce * Red Hat, Inc * New York