diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-02-27 23:15:27 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-03-01 20:11:49 +0100 |
commit | 7271345efe182199acaeae602cb78a94a7c6dc9d (patch) | |
tree | 5808d9238ebbd5e12f4d7d1cf9c0617f166c3fac | |
parent | 26ae658a83eeca16780cf5615c8247cbb151c3fa (diff) | |
download | slirp-7271345efe182199acaeae602cb78a94a7c6dc9d.zip slirp-7271345efe182199acaeae602cb78a94a7c6dc9d.tar.gz slirp-7271345efe182199acaeae602cb78a94a7c6dc9d.tar.bz2 |
Disable polling for PRI on MacOS
Fixes #35.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
-rw-r--r-- | src/slirp.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/slirp.c b/src/slirp.c index c04d645..79ba734 100644 --- a/src/slirp.c +++ b/src/slirp.c @@ -718,10 +718,16 @@ void slirp_pollfds_poll(Slirp *slirp, int select_error, continue; } +#ifndef __APPLE__ /* * Check for URG data * This will soread as well, so no need to - * test for SLIRP_POLL_IN below if this succeeds + * test for SLIRP_POLL_IN below if this succeeds. + * + * This is however disabled on MacOS, which apparently always + * reports data as PRI when it is the last data of the + * connection. We would then report it out of band, which the guest + * would most probably not be ready for. */ if (revents & SLIRP_POLL_PRI) { ret = sorecvoob(so); @@ -734,8 +740,10 @@ void slirp_pollfds_poll(Slirp *slirp, int select_error, /* * Check sockets for reading */ - else if (revents & - (SLIRP_POLL_IN | SLIRP_POLL_HUP | SLIRP_POLL_ERR)) { + else +#endif + if (revents & + (SLIRP_POLL_IN | SLIRP_POLL_HUP | SLIRP_POLL_ERR | SLIRP_POLL_PRI)) { /* * Check for incoming connections */ |