aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-06-30 14:05:19 +0000
committerRob Landley <rob@landley.net>2006-06-30 14:05:19 +0000
commit00c051e42d91bf39f8fa1937c01faf8265ac5c10 (patch)
treebf31f70bb1523c62cde0b75ab8602105df976ff3
parentc340ea191ab39edbff08f0a39a7b9ee47f3be21b (diff)
downloadbusybox-00c051e42d91bf39f8fa1937c01faf8265ac5c10.tar.gz
Bug http://bugs.busybox.net/view.php?id=723 - initialize tv1 the first time
through the loop.
-rw-r--r--networking/zcip.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/networking/zcip.c b/networking/zcip.c
index e25f01755..836cb78b2 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -307,20 +307,20 @@ fail:
fds[0].revents = 0;
// poll, being ready to adjust current timeout
- if (timeout > 0) {
- gettimeofday(&tv1, NULL);
- tv1.tv_usec += (timeout % 1000) * 1000;
- while (tv1.tv_usec > 1000000) {
- tv1.tv_usec -= 1000000;
- tv1.tv_sec++;
- }
- tv1.tv_sec += timeout / 1000;
- } else if (timeout == 0) {
+ if (!timeout) {
timeout = ms_rdelay(PROBE_WAIT);
// FIXME setsockopt(fd, SO_ATTACH_FILTER, ...) to
// make the kernel filter out all packets except
// ones we'd care about.
}
+ gettimeofday(&tv1, NULL);
+ tv1.tv_usec += (timeout % 1000) * 1000;
+ while (tv1.tv_usec > 1000000) {
+ tv1.tv_usec -= 1000000;
+ tv1.tv_sec++;
+ }
+ tv1.tv_sec += timeout / 1000;
+
VDBG("...wait %ld %s nprobes=%d, nclaims=%d\n",
timeout, intf, nprobes, nclaims);
switch (poll(fds, 1, timeout)) {