Fix lshal cannot be run without root
Root cause is invoking copy constructor on a Return<T> object
implicitly, while the old object contains a failed status and
gets destroyed. Use the move constructor instead to fix this.
Test: adb unroot && adb shell lshal
Change-Id: I44710166cc5d7da30bf54b10d1860be1b91dc98a
diff --git a/cmds/lshal/Timeout.h b/cmds/lshal/Timeout.h
index bf883c0..001c3d6 100644
--- a/cmds/lshal/Timeout.h
+++ b/cmds/lshal/Timeout.h
@@ -69,7 +69,7 @@
auto boundFunc = std::bind(std::forward<Function>(func),
interfaceObject.get(), std::forward<Args>(args)...);
bool success = timeout(IPC_CALL_WAIT, [&ret, &boundFunc] {
- ret = boundFunc();
+ ret = std::move(boundFunc());
});
if (!success) {
return Status::fromStatusT(TIMED_OUT);