bootctl: Return<T> is non-copyable.
By copying the Return<T> in handl_return, the original
Return<T> object is left status unchecked when it is destroyed.
Test: compiles
Change-Id: I7bf21370e8323374deb9a8d3f252e9742357f000
diff --git a/bootctl/bootctl.cpp b/bootctl/bootctl.cpp
index 2b3865e..6dda28f 100644
--- a/bootctl/bootctl.cpp
+++ b/bootctl/bootctl.cpp
@@ -83,7 +83,7 @@
};
}
-static int handle_return(Return<void> ret, CommandResult cr, const char* errStr) {
+static int handle_return(const Return<void> &ret, CommandResult cr, const char* errStr) {
if (!ret.isOk()) {
fprintf(stderr, errStr, ret.description().c_str());
return EX_SOFTWARE;
@@ -117,7 +117,7 @@
return handle_return(ret, cr, "Error setting slot as unbootable: %s\n");
}
-static int handle_return(Return<BoolResult> ret, const char* errStr) {
+static int handle_return(const Return<BoolResult> &ret, const char* errStr) {
if (!ret.isOk()) {
fprintf(stderr, errStr, ret.description().c_str());
return EX_SOFTWARE;