diff options
author | Rob Landley <rob@landley.net> | 2006-06-30 14:05:19 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-06-30 14:05:19 +0000 |
commit | 00c051e42d91bf39f8fa1937c01faf8265ac5c10 (patch) | |
tree | bf31f70bb1523c62cde0b75ab8602105df976ff3 | |
parent | c340ea191ab39edbff08f0a39a7b9ee47f3be21b (diff) | |
download | busybox-w32-00c051e42d91bf39f8fa1937c01faf8265ac5c10.tar.gz busybox-w32-00c051e42d91bf39f8fa1937c01faf8265ac5c10.tar.bz2 busybox-w32-00c051e42d91bf39f8fa1937c01faf8265ac5c10.zip |
Bug http://bugs.busybox.net/view.php?id=723 - initialize tv1 the first time
through the loop.
-rw-r--r-- | networking/zcip.c | 18 |
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: | |||
307 | fds[0].revents = 0; | 307 | fds[0].revents = 0; |
308 | 308 | ||
309 | // poll, being ready to adjust current timeout | 309 | // poll, being ready to adjust current timeout |
310 | if (timeout > 0) { | 310 | if (!timeout) { |
311 | gettimeofday(&tv1, NULL); | ||
312 | tv1.tv_usec += (timeout % 1000) * 1000; | ||
313 | while (tv1.tv_usec > 1000000) { | ||
314 | tv1.tv_usec -= 1000000; | ||
315 | tv1.tv_sec++; | ||
316 | } | ||
317 | tv1.tv_sec += timeout / 1000; | ||
318 | } else if (timeout == 0) { | ||
319 | timeout = ms_rdelay(PROBE_WAIT); | 311 | timeout = ms_rdelay(PROBE_WAIT); |
320 | // FIXME setsockopt(fd, SO_ATTACH_FILTER, ...) to | 312 | // FIXME setsockopt(fd, SO_ATTACH_FILTER, ...) to |
321 | // make the kernel filter out all packets except | 313 | // make the kernel filter out all packets except |
322 | // ones we'd care about. | 314 | // ones we'd care about. |
323 | } | 315 | } |
316 | gettimeofday(&tv1, NULL); | ||
317 | tv1.tv_usec += (timeout % 1000) * 1000; | ||
318 | while (tv1.tv_usec > 1000000) { | ||
319 | tv1.tv_usec -= 1000000; | ||
320 | tv1.tv_sec++; | ||
321 | } | ||
322 | tv1.tv_sec += timeout / 1000; | ||
323 | |||
324 | VDBG("...wait %ld %s nprobes=%d, nclaims=%d\n", | 324 | VDBG("...wait %ld %s nprobes=%d, nclaims=%d\n", |
325 | timeout, intf, nprobes, nclaims); | 325 | timeout, intf, nprobes, nclaims); |
326 | switch (poll(fds, 1, timeout)) { | 326 | switch (poll(fds, 1, timeout)) { |