tools/helper: Streamline return types
These functions can already return exceptions, so make better use of
them for reporting failures.
Change-Id: I572e9e3ee44bbd5add601f3246bb4f95cb9308bf
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/tools/handler.cpp b/tools/handler.cpp
index a87793e..2b847a9 100644
--- a/tools/handler.cpp
+++ b/tools/handler.cpp
@@ -115,7 +115,8 @@
std::fprintf(stderr, "Calling stat on %s session to check status\n",
target.c_str());
- return pollStatus(*session, blob);
+ pollStatus(*session, blob);
+ return true;
}
catch (const ipmiblob::BlobException& b)
{
@@ -139,10 +140,10 @@
/* TODO: call readBytes multiple times in case IPMI message length
* exceeds IPMI_MAX_MSG_LENGTH.
*/
- auto pollResp = pollReadReady(*session, blob);
- if (pollResp.first && pollResp.second > 0)
+ auto size = pollReadReady(*session, blob);
+ if (size > 0)
{
- return blob->readBytes(*session, 0, pollResp.second);
+ return blob->readBytes(*session, 0, size);
}
return {};
}