aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-04-13 19:35:04 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-04-26 13:14:58 -0500
commit4351a4fe779227e2d3047764ba4817edf0b8c002 (patch)
tree7eee739cbcc180622b62833b869c3bbbd7074674
parentd4ab69d39bbe8f2cf40bc474c4bdfab6d7f0f6a0 (diff)
downloadslirp-1.1.0-rc3.zip
slirp-1.1.0-rc3.tar.gz
slirp-1.1.0-rc3.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.h1
-rw-r--r--slirp.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/libslirp.h b/libslirp.h
index 6ee804d..3f8a9be 100644
--- a/libslirp.h
+++ b/libslirp.h
@@ -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);
diff --git a/slirp.c b/slirp.c
index aec7250..b61af4e 100644
--- a/slirp.c
+++ b/slirp.c
@@ -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)
{