diff options
author | NIIBE Yutaka <[email protected]> | 2019-08-23 01:30:24 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2019-08-23 01:30:24 +0000 |
commit | 157b9f6fafb6905fd94c21aaa9e2c103d954a9fc (patch) | |
tree | a48af5df5eb066c3edb37d8df9bc510bf5801e19 | |
parent | estream: Fix gpgrt_poll to prevent waiting indefinitely for others. (diff) | |
download | libgpg-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.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; |