summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yifan Hong <elsk@google.com> 2021-09-21 13:38:11 -0700
committer Yifan Hong <elsk@google.com> 2021-09-21 23:41:11 +0000
commitb0ae543d43d2ef70ba6f7aafb5b2c7a6c065853a (patch)
tree28cf94800da3a2f504e707198a3997d7007547e7
parentaa677d973e4a609804f70f887fd2bb07bbcea67a (diff)
lshal: exhaust pipe before closing.
If there is a pending close request on the pipe, but there's still data in the pipe, exhaust it. Test: com.google.android.power.pts.PowerTest#power2RockBottomCheckTest Bug: 200623090 Change-Id: Iaaa4ba0c3af480671d7d63f9b2dbf682277a3430
-rw-r--r--cmds/lshal/PipeRelay.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmds/lshal/PipeRelay.cpp b/cmds/lshal/PipeRelay.cpp
index 0c3fb9663e..863490d314 100644
--- a/cmds/lshal/PipeRelay.cpp
+++ b/cmds/lshal/PipeRelay.cpp
@@ -82,6 +82,7 @@ void PipeRelay::thread(unique_fd rfd, unique_fd rfdTrigger, std::ostream* out,
continue;
}
out->write(buffer, n);
+ continue;
}
if (pfd[0].revents & POLLHUP) {
break;