diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-01-17 15:43:41 +0400 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-02-07 15:49:08 +0200 |
commit | 848c7092ba69318e7bc72a9c0c1f6cd443c439ad (patch) | |
tree | a5f4a80e8be467676ce6d8dce38dc4dc6669bf8d /slirp/tcp_subr.c | |
parent | 707bd47ef3cf778b691d9e0df2ede3ec4c3fe771 (diff) |
slirp: replace qemu_set_nonblock()
Replace qemu_set_nonblock() with slirp_set_nonblock()
qemu_set_nonblock() does some event registration with the main
loop. Add a new callback register_poll_fd() for that reason.
Always build the fd-register stub, to avoid #if WIN32.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/tcp_subr.c')
-rw-r--r-- | slirp/tcp_subr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index 3567f320ff..8087ffc047 100644 --- a/slirp/tcp_subr.c +++ b/slirp/tcp_subr.c @@ -412,7 +412,8 @@ int tcp_fconnect(struct socket *so, unsigned short af) int opt, s=so->s; struct sockaddr_storage addr; - qemu_set_nonblock(s); + slirp_set_nonblock(s); + so->slirp->cb->register_poll_fd(so->s); slirp_socket_set_fast_reuse(s); opt = 1; slirp_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(opt)); @@ -484,7 +485,8 @@ void tcp_connect(struct socket *inso) tcp_close(sototcpcb(so)); /* This will sofree() as well */ return; } - qemu_set_nonblock(s); + slirp_set_nonblock(s); + so->slirp->cb->register_poll_fd(so->s); slirp_socket_set_fast_reuse(s); opt = 1; slirp_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int)); |