[Bug 51282] "Could not add client names match rule" warning at startup
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Fri Jun 22 07:17:12 CEST 2012
https://bugs.freedesktop.org/show_bug.cgi?id=51282
Simon McVittie <simon.mcvittie at collabora.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status Whiteboard| |review-
Keywords| |patch
--- Comment #4 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-06-22 05:17:12 UTC ---
I agree in principle, but:
If add_match (., CLIENT_MATCH_RULE, .) fails, that just means you don't have
D-Bus 1.6.
If add_match (., NAME_OWNER_RULE, .) fails, that should still be a warning, or
even a critical.
I see two options:
1) Add a parameter "required_version" to add_match. If it's NULL, issue a
warning (or even a critical): "Could not add %s match rule: %s". If it's
non-NULL, issue a debug message: "Could not add %s match rule, which requires
D-Bus %s: %s".
2) Flatten add_match into its caller, and do the error handling there.
---
While you're in the vicinity, I notice that the boolean "arg0_filtered" makes
very little sense. It's set to the return from dbus_connection_add_filter(),
which is documented to mean "there was enough memory"; and in any case, if we
can't add the filter, MC is not going to work correctly. So I think it should
go more like this:
if (!dbus_connection_add_filter (dconn, ..._filter, self, NULL))
g_critical ("Could not add filter for NameOwnerChanged (out of memory?)");
dbus_error_init (&error);
if (dbus_bus_add_match (dconn, CLIENT_MATCH_RULE, &error))
{
DEBUG ("...");
dbus_error_free (&error);
if (!dbus_bus_add_match (dconn, NAME_OWNER_RULE, &error))
{
g_critical ("...");
dbus_error_free (&error);
}
}
(Or the equivalent with non-inlined add_match() if you prefer.)
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the telepathy-bugs
mailing list