Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

ares_timeout.c: fix compiler warning

  • Loading branch information...
commit 38a9933a6dd6242beaa865e267a575e61aead8d6 1 parent f7b66af
yangtse yangtse authored

Showing 1 changed file with 11 additions and 10 deletions. Show diff stats Hide diff stats

  1. +11 10 ares_timeout.c
21 ares_timeout.c
@@ -62,19 +62,20 @@ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
62 62 min_offset = offset;
63 63 }
64 64
65   - if(min_offset != -1) {
66   - nextstop.tv_sec = min_offset/1000;
67   - nextstop.tv_usec = (min_offset%1000)*1000;
68   - }
69   -
70 65 /* If we found a minimum timeout and it's sooner than the one specified in
71 66 * maxtv (if any), return it. Otherwise go with maxtv.
72 67 */
73   - if (min_offset != -1 && (!maxtv || ares__timedout(maxtv, &nextstop)))
  68 + if (min_offset != -1)
74 69 {
75   - *tvbuf = nextstop;
76   - return tvbuf;
  70 + nextstop.tv_sec = min_offset/1000;
  71 + nextstop.tv_usec = (min_offset%1000)*1000;
  72 +
  73 + if (!maxtv || ares__timedout(maxtv, &nextstop))
  74 + {
  75 + *tvbuf = nextstop;
  76 + return tvbuf;
  77 + }
77 78 }
78   - else
79   - return maxtv;
  79 +
  80 + return maxtv;
80 81 }

0 comments on commit 38a9933

Please sign in to comment.
Something went wrong with that request. Please try again.