Change return codes to match sd-bus convention
in sd-bus callbacks we should be following the same conventions as
sd-bus, returning 0 for success, and returning some correct errno for
failure. This changes the couple spots I found to follow that
convention.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I9914e35d4938e31c2d94c4f165108606263ac0e7
diff --git a/include/sdbusplus/asio/detail/async_send_handler.hpp b/include/sdbusplus/asio/detail/async_send_handler.hpp
index 0f40ce9..dafc7a8 100644
--- a/include/sdbusplus/asio/detail/async_send_handler.hpp
+++ b/include/sdbusplus/asio/detail/async_send_handler.hpp
@@ -41,7 +41,7 @@
{
if (userdata == nullptr)
{
- return -1;
+ return -EINVAL;
}
// Take RAII ownership of the pointer again
@@ -50,13 +50,13 @@
if (mesg == nullptr)
{
- return -1;
+ return -EINVAL;
}
message_t message(mesg);
auto ec = make_error_code(
static_cast<boost::system::errc::errc_t>(message.get_errno()));
context->handler_(ec, message);
- return 1;
+ return 0;
}
};