diff options
author | Inga Stotland <inga.stotland@intel.com> | 2019-07-04 00:40:40 -0700 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2019-07-04 10:08:49 -0700 |
commit | 70ffc81605df65a26569eaa61cb156646b2b1483 (patch) | |
tree | 7dbc0ec7b61c831e7bdeb234dc389161597a5b4b /mesh/dbus.c | |
parent | 5f896b47955b5e35d62edb87e44b9baeb9992684 (diff) | |
download | bluez-70ffc81605df65a26569eaa61cb156646b2b1483.tar.gz |
mesh: Use l_dbus_message...() APIs in more consistent fashion
This removes checks for the return values of l_dbus_message...()
calls in the few places where we can rely on ell to handle error
cases gracefully.
Diffstat (limited to 'mesh/dbus.c')
-rw-r--r-- | mesh/dbus.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mesh/dbus.c b/mesh/dbus.c index 2b700a1ad..6b9694ab7 100644 --- a/mesh/dbus.c +++ b/mesh/dbus.c @@ -113,29 +113,29 @@ bool dbus_match_interface(struct l_dbus_message_iter *interfaces, return false; } -bool dbus_append_byte_array(struct l_dbus_message_builder *builder, +void dbus_append_byte_array(struct l_dbus_message_builder *builder, const uint8_t *data, int len) { int i; - if (!l_dbus_message_builder_enter_array(builder, "y")) - return false; + if (!builder) + return; - for (i = 0; i < len; i++) - if (!l_dbus_message_builder_append_basic(builder, 'y', - data + i)) - return false; + l_dbus_message_builder_enter_array(builder, "y"); - if (!l_dbus_message_builder_leave_array(builder)) - return false; + for (i = 0; i < len; i++) + l_dbus_message_builder_append_basic(builder, 'y', data + i); - return true; + l_dbus_message_builder_leave_array(builder); } void dbus_append_dict_entry_basic(struct l_dbus_message_builder *builder, const char *key, const char *signature, const void *data) { + if (!builder) + return; + l_dbus_message_builder_enter_dict(builder, "sv"); l_dbus_message_builder_append_basic(builder, 's', key); l_dbus_message_builder_enter_variant(builder, signature); |