From 157b9f6fafb6905fd94c21aaa9e2c103d954a9fc Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 23 Aug 2019 10:30:24 +0900 Subject: estream: Fix gpgrt_poll at EOF. * src/estream.c [HAVE_POLL_H] (_gpgrt_poll): Catch POLLHUP event for want_read. -- At EOF, here is a difference of semantics between poll(2) and select(2). For poll(2), detection of EOF is an event of POLLHUP, not POLLIN. Fixes-commit: a21a7de8c2cf986235382e7e04805744f6df116e Signed-off-by: NIIBE Yutaka --- src/estream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/estream.c b/src/estream.c index 0d8f522..a23d817 100644 --- a/src/estream.c +++ b/src/estream.c @@ -4982,7 +4982,7 @@ _gpgrt_poll (gpgrt_poll_t *fds, unsigned int nfds, int timeout) item->got_hup = 1; any = 1; } - if (item->want_read && (poll_fds[poll_nfds].revents & POLLIN)) + if (item->want_read && (poll_fds[poll_nfds].revents & (POLLIN|POLLHUP))) { item->got_read = 1; any = 1; -- cgit v1.2.3