<br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The two watches probably have different flags (one is supposed to be<br>watched for reading, one for writing). So they are in fact different and
<br>you need to add both of them, with different conditions watched for<br>depending on the flags.</blockquote><div><br>That is indeed the case. Are read and write mutually exclusive, or do I need to look out for watches that need to be added to both read and write mappings (I'm planning on keeping a mapping from fd -> watch).
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Looking at the main loop used by dbus-daemon itself, it appears to rely<br>on it being OK to pass the same fd to poll() twice with different flags.
<br>I don't know if this is really OK; it's possible there's a bug here in<br>dbus-daemon.<br><br>One of the watches is for writing and will only be enabled when there<br>are outgoing messages to write. The other message is for reading and
<br>will more or less always be enabled.</blockquote><div><br>Ok, that makes sense.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The free function passed to set_watch_functions() is to free the "void<br>*data" you supplied when the DBusConnection is destroyed. You need not<br>supply a free function if you did not supply any data that needs freeing.
</blockquote><div><br>I must have missed that :) I'm still trying to get the overall view of how the system works, so I'm probably still missing plenty of important things.<br></div><br></div>