Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38903c0f authored by Yifan Hong's avatar Yifan Hong
Browse files

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
parent 9753b433
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ timeoutIPC(const sp<I> &interfaceObject, Function &&func, Args &&... args) {
    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);