diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-10-07 23:27:35 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-10-07 23:27:35 +0000 |
commit | 3b92498f69346ccbd24872f41d54c27ffb36f66f (patch) | |
tree | d4d2883bfdd3c41e8cc5dc6ebe1b5dfebac36c7e /slirp.c | |
parent | 831e0fc92bf3c47ac605499f4bb30e530179cf7c (diff) | |
download | slirp-3b92498f69346ccbd24872f41d54c27ffb36f66f.zip slirp-3b92498f69346ccbd24872f41d54c27ffb36f66f.tar.gz slirp-3b92498f69346ccbd24872f41d54c27ffb36f66f.tar.bz2 |
windows fixes (Gregory Alexander)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1102 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'slirp.c')
-rw-r--r-- | slirp.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -417,7 +417,7 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds) /* Connected */ so->so_state &= ~SS_ISFCONNECTING; - ret = write(so->s, &ret, 0); + ret = send(so->s, &ret, 0, 0); if (ret < 0) { /* XXXXX Must fix, zero bytes is a NOP */ if (errno == EAGAIN || errno == EWOULDBLOCK || @@ -450,7 +450,7 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds) */ #ifdef PROBE_CONN if (so->so_state & SS_ISFCONNECTING) { - ret = read(so->s, (char *)&ret, 0); + ret = recv(so->s, (char *)&ret, 0, 0); if (ret < 0) { /* XXX */ @@ -463,7 +463,7 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds) /* tcp_input will take care of it */ } else { - ret = write(so->s, &ret, 0); + ret = send(so->s, &ret, 0, 0); if (ret < 0) { /* XXX */ if (errno == EAGAIN || errno == EWOULDBLOCK || @@ -498,6 +498,15 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds) */ if (if_queued && link_up) if_start(); + + /* clear global file descriptor sets. + * these reside on the stack in vl.c + * so they're unusable if we're not in + * slirp_select_fill or slirp_select_poll. + */ + global_readfds = NULL; + global_writefds = NULL; + global_xfds = NULL; } #define ETH_ALEN 6 |