should request_name org.freedesktop.DBus fail?
Robert McQueen
robert.mcqueen at collabora.co.uk
Mon Nov 7 04:06:01 PST 2005
At risk of talking to myself... on a related note, if you request a
garbage name, the method returns 0 but does not set an error, because
the library uses:
_dbus_return_val_if_fail (_dbus_check_is_valid_bus_name (name), 0);
At the start of the function, amongst others.
This and others like it should either be made to return an error, or the
fact this function can return 0 in unspecific error cases (rather one of
the return values in the documentation) made clear in the API
documentation and spec.
Regards,
Rob
Robert McQueen wrote:
> I've just been refactoring some of the bus name request code in the
> Python bindings, and wrote a test case to check that errors were being
> correctly caught (a first for bus names in the Python bindings...
> hnnrgh). I wanted something that would always be taken, so I tried
> requesting org.freedesktop.DBus, but it retured
> DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER. Given that you can /always/ send
> messages to the bus on org.freedesktop.DBus, surely you should never be
> able to think you've registered this name?
>
> Regards,
> Rob
More information about the dbus
mailing list