summaryrefslogtreecommitdiff
path: root/ares_timeout.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2012-04-25 15:49:26 +0200
committerYang Tse <yangsita@gmail.com>2012-04-25 15:49:26 +0200
commit38a9933a6dd6242beaa865e267a575e61aead8d6 (patch)
tree7798c91fc127ba83df51623cfb462f82b8081f56 /ares_timeout.c
parentf7b66af2002c8f1de8f732238ebf5fe0f24706cd (diff)
downloadc-ares-38a9933a6dd6242beaa865e267a575e61aead8d6.tar.gz
c-ares-38a9933a6dd6242beaa865e267a575e61aead8d6.tar.bz2
c-ares-38a9933a6dd6242beaa865e267a575e61aead8d6.zip
ares_timeout.c: fix compiler warning
Diffstat (limited to 'ares_timeout.c')
-rw-r--r--ares_timeout.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/ares_timeout.c b/ares_timeout.c
index 2da4f5f..738ad15 100644
--- a/ares_timeout.c
+++ b/ares_timeout.c
@@ -62,19 +62,20 @@ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
min_offset = offset;
}
- if(min_offset != -1) {
- nextstop.tv_sec = min_offset/1000;
- nextstop.tv_usec = (min_offset%1000)*1000;
- }
-
/* If we found a minimum timeout and it's sooner than the one specified in
* maxtv (if any), return it. Otherwise go with maxtv.
*/
- if (min_offset != -1 && (!maxtv || ares__timedout(maxtv, &nextstop)))
+ if (min_offset != -1)
{
- *tvbuf = nextstop;
- return tvbuf;
+ nextstop.tv_sec = min_offset/1000;
+ nextstop.tv_usec = (min_offset%1000)*1000;
+
+ if (!maxtv || ares__timedout(maxtv, &nextstop))
+ {
+ *tvbuf = nextstop;
+ return tvbuf;
+ }
}
- else
- return maxtv;
+
+ return maxtv;
}