From e9fd43e04191a979cfac27bfb763a936150dad7c Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 13 Feb 2020 18:16:51 +0000 Subject: [PATCH] raw file: drain POLLIN before handling close as needed for pipes --- lib/roles/raw-file/ops-raw-file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/roles/raw-file/ops-raw-file.c b/lib/roles/raw-file/ops-raw-file.c index 67660e6d6..cb7160d05 100644 --- a/lib/roles/raw-file/ops-raw-file.c +++ b/lib/roles/raw-file/ops-raw-file.c @@ -50,7 +50,8 @@ rops_handle_POLLIN_raw_file(struct lws_context_per_thread *pt, struct lws *wsi, } if (pollfd->revents & LWS_POLLHUP) - return LWS_HPI_RET_PLEASE_CLOSE_ME; + if (!(pollfd->revents & LWS_POLLIN)) + return LWS_HPI_RET_PLEASE_CLOSE_ME; return LWS_HPI_RET_HANDLED; }