summaryrefslogtreecommitdiff
path: root/bootctl
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2017-02-17 14:35:07 -0800
committerYifan Hong <elsk@google.com>2017-02-17 22:49:38 +0000
commit83a2fdb4e10b9c308d470fd3bc99f483fc0af2bd (patch)
tree9efd8f703363d9f5d059876467dd98691b0d7f50 /bootctl
parentff972054e9a876a79fbe6a3ba075536e621234ed (diff)
downloadextras-83a2fdb4e10b9c308d470fd3bc99f483fc0af2bd.tar.gz
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
Diffstat (limited to 'bootctl')
-rw-r--r--bootctl/bootctl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/bootctl/bootctl.cpp b/bootctl/bootctl.cpp
index 2b3865e5..6dda28fb 100644
--- a/bootctl/bootctl.cpp
+++ b/bootctl/bootctl.cpp
@@ -83,7 +83,7 @@ static std::function<void(CommandResult)> generate_callback(CommandResult *crp)
};
}
-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 @@ static int do_set_slot_as_unbootable(sp<IBootControl> module,
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;