diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-10-23 12:05:49 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-10-25 09:54:37 +0200 |
commit | b9d25f9a6b3ca791385b80a6a3c3fa5ae113e1e0 (patch) | |
tree | ad56d8b7a703e96e9de0ef07bacab079b7169904 /lib/asyn-ares.c | |
parent | 016c6a6abb525ffb9431a00a4eda6b70683f838e (diff) | |
download | curl-b9d25f9a6b3ca791385b80a6a3c3fa5ae113e1e0.tar.gz |
timediff: return timediff_t from the time diff functions
... to cater for systems with unsigned time_t variables.
- Renamed the functions to curlx_timediff and Curl_timediff_us.
- Added overflow protection for both of them in either direction for
both 32 bit and 64 bit time_ts
- Reprefixed the curlx_time functions to use Curl_*
Reported-by: Peter Piekarski
Fixes #2004
Closes #2005
Diffstat (limited to 'lib/asyn-ares.c')
-rw-r--r-- | lib/asyn-ares.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index 87e70b4d9..0fbf321b9 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -401,7 +401,7 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn, result = CURLE_ABORTED_BY_CALLBACK; else { struct curltime now2 = Curl_tvnow(); - time_t timediff = Curl_tvdiff(now2, now); /* spent time */ + timediff_t timediff = Curl_timediff(now2, now); /* spent time */ if(timediff <= 0) timeout -= 1; /* always deduct at least 1 */ else if(timediff > timeout) |