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

Commit 91dd25ca authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "libbinder: Handle peer closing connection in Trusty" am: a1cf02cf am:...

Merge "libbinder: Handle peer closing connection in Trusty" am: a1cf02cf am: c0e7936d am: 8b2e672a

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2336530



Change-Id: I50468bd6ee557d5b180456a382797bd7f021c6bb
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ef312393 8b2e672a
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -63,12 +63,14 @@ public:
        if (pfd.revents & POLLERR) {
            return DEAD_OBJECT;
        }
        if (pfd.revents & POLLHUP) {
            return DEAD_OBJECT;
        }
        if (pfd.revents & POLLIN) {
            // Copied from FdTrigger.cpp: Even though POLLHUP may also be set,
            // treat it as a success condition to ensure data is drained.
            return OK;
        }
        if (pfd.revents & POLLHUP) {
            return DEAD_OBJECT;
        }

        return WOULD_BLOCK;
    }
+6 −0
Original line number Diff line number Diff line
@@ -239,6 +239,12 @@ private:
        }
        if (!(uevt.event & IPC_HANDLE_POLL_MSG)) {
            /* No message, terminate here and leave mHaveMessage false */
            if (uevt.event & IPC_HANDLE_POLL_HUP) {
                // Peer closed the connection. We need to preserve the order
                // between MSG and HUP from FdTrigger.cpp, which means that
                // getting MSG&HUP should return OK instead of DEAD_OBJECT.
                return DEAD_OBJECT;
            }
            return OK;
        }