diff options
author | David 'Digit' Turner <digit@android.com> | 2010-07-30 15:35:00 -0700 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2010-07-30 15:35:00 -0700 |
commit | 9b98dbde344781e93e2bdcfa599428cda2fda41d (patch) | |
tree | 984065a5cd8d66a99000096fb2018f3ba7988320 /iolooper-select.c | |
parent | 7fd67eba0b961d94a5d6baa8e3c3de37b729f738 (diff) | |
download | external_qemu-9b98dbde344781e93e2bdcfa599428cda2fda41d.zip external_qemu-9b98dbde344781e93e2bdcfa599428cda2fda41d.tar.gz external_qemu-9b98dbde344781e93e2bdcfa599428cda2fda41d.tar.bz2 |
Better detection of incorrect proxy values when starting the emulator.
Change-Id: I344f06fc16e051359669b8fe9b8dcec0ceca377d
Diffstat (limited to 'iolooper-select.c')
-rw-r--r-- | iolooper-select.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/iolooper-select.c b/iolooper-select.c index bf7ae8f..f5aecbd 100644 --- a/iolooper-select.c +++ b/iolooper-select.c @@ -146,17 +146,26 @@ iolooper_wait( IoLooper* iol, int64_t duration ) int count = iolooper_fd_count(iol); int ret; fd_set errs; + struct timeval tm0, *tm = NULL; if (count == 0) return 0; + if (duration < 0) + tm = NULL; + else { + tm = &tm0; + tm->tv_sec = duration / 1000; + tm->tv_usec = (duration - 1000*tm->tv_sec) * 1000; + } + FD_ZERO(&errs); do { iol->reads_result[0] = iol->reads[0]; iol->writes_result[0] = iol->writes[0]; - ret = select( count, iol->reads_result, iol->writes_result, &errs, NULL); + ret = select( count, iol->reads_result, iol->writes_result, &errs, tm); } while (ret < 0 && errno == EINTR); return ret; |