diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2019-08-23 10:30:24 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2019-08-23 10:30:24 +0900 |
commit | 157b9f6fafb6905fd94c21aaa9e2c103d954a9fc (patch) | |
tree | a48af5df5eb066c3edb37d8df9bc510bf5801e19 /src/estream.c | |
parent | ab87480fc201ad687153429aee043ab454fed0a3 (diff) | |
download | libgpg-error-157b9f6fafb6905fd94c21aaa9e2c103d954a9fc.tar.gz |
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 <gniibe@fsij.org>
Diffstat (limited to 'src/estream.c')
-rw-r--r-- | src/estream.c | 2 |
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; |