diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2012-04-13 19:35:04 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-04-26 13:14:58 -0500 |
commit | 4351a4fe779227e2d3047764ba4817edf0b8c002 (patch) | |
tree | 7eee739cbcc180622b62833b869c3bbbd7074674 | |
parent | d4ab69d39bbe8f2cf40bc474c4bdfab6d7f0f6a0 (diff) | |
download | slirp-4351a4fe779227e2d3047764ba4817edf0b8c002.zip slirp-4351a4fe779227e2d3047764ba4817edf0b8c002.tar.gz slirp-4351a4fe779227e2d3047764ba4817edf0b8c002.tar.bz2 |
main_loop_wait: block indefinitelyv1.1.0-rc3v1.1.0-rc2v1.1-rc2v1.1-rc1v1.1-rc0
- remove qemu_calculate_timeout;
- explicitly size timeout to uint32_t;
- introduce slirp_update_timeout;
- pass NULL as timeout argument to select in case timeout is the maximum
value;
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Paul Brook <paul@codesourcery.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | libslirp.h | 1 | ||||
-rw-r--r-- | slirp.c | 7 |
2 files changed, 8 insertions, 0 deletions
@@ -15,6 +15,7 @@ Slirp *slirp_init(int restricted, struct in_addr vnetwork, struct in_addr vnameserver, void *opaque); void slirp_cleanup(Slirp *slirp); +void slirp_update_timeout(uint32_t *timeout); void slirp_select_fill(int *pnfds, fd_set *readfds, fd_set *writefds, fd_set *xfds); @@ -261,6 +261,13 @@ void slirp_cleanup(Slirp *slirp) if (nfds < (x)) \ nfds = (x) +void slirp_update_timeout(uint32_t *timeout) +{ + if (!QTAILQ_EMPTY(&slirp_instances)) { + *timeout = MIN(1000, *timeout); + } +} + void slirp_select_fill(int *pnfds, fd_set *readfds, fd_set *writefds, fd_set *xfds) { |