openbmc / sdbusplus

C++ bindings for systemd dbus APIs
Apache License 2.0
104 stars 82 forks source link

request_name does not propagate error state/return code #21

Closed aiQon closed 1 year ago

aiQon commented 6 years ago

I just noticed that if I try to request a name on dbus with sdbusplus::bus::request_name, I do not get a return code from the underlying implementation. This conveniently hid a bug with policy configuration in my case. Is there a reason for doing so or might a simple return do the trick in the implementation?

whame commented 6 years ago

Yeah, I just realized that as well. There are also other places where return codes are completely ignored (for instance sd_bus_open, sd_bus_open_user and sd_bus_open_system)

These should certainly be fixed. However, checking request_name was sufficient for my application. I have pushed the changes to their Gerrit instance.

wak-google commented 6 years ago

I've been doing some work to try and fix all of these but it takes time to recover from the fallout where we depend on the error case not failing. I suspect this one and quite a few others will be trivial though.

williamspatrick commented 1 year ago

request_name now checks return code. Many others have been fixed as well. Please report any new ones.