From: Yang Tse Date: Wed, 25 Apr 2012 13:49:26 +0000 (+0200) Subject: ares_timeout.c: fix compiler warning X-Git-Tag: upstream/1.10.0~104 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38a9933a6dd6242beaa865e267a575e61aead8d6;p=platform%2Fupstream%2Fc-ares.git ares_timeout.c: fix compiler warning --- 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; }