aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2019-08-23 01:30:24 +0000
committerNIIBE Yutaka <[email protected]>2019-08-23 01:30:24 +0000
commit157b9f6fafb6905fd94c21aaa9e2c103d954a9fc (patch)
treea48af5df5eb066c3edb37d8df9bc510bf5801e19
parentestream: Fix gpgrt_poll to prevent waiting indefinitely for others. (diff)
downloadlibgpg-error-157b9f6fafb6905fd94c21aaa9e2c103d954a9fc.tar.gz
libgpg-error-157b9f6fafb6905fd94c21aaa9e2c103d954a9fc.zip
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 <[email protected]>
-rw-r--r--src/estream.c2
1 files changed, 1 insertions, 1 deletions
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;