summaryrefslogtreecommitdiff
path: root/deps/cares/src/ares_timeout.c
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-05-14 01:54:58 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-05-14 02:07:35 +0200
commit9498fd15c70c2daf386dda13c43d7a2d984f0892 (patch)
tree77972dbe7fd421211d894ef5b112b2cfabebe22e /deps/cares/src/ares_timeout.c
parent458c8bb9f86f1666cbbbe1f2951e7ca86756c48f (diff)
downloadandroid-node-v8-9498fd15c70c2daf386dda13c43d7a2d984f0892.tar.gz
android-node-v8-9498fd15c70c2daf386dda13c43d7a2d984f0892.tar.bz2
android-node-v8-9498fd15c70c2daf386dda13c43d7a2d984f0892.zip
deps: upgrade c-ares to 1.10.0
Diffstat (limited to 'deps/cares/src/ares_timeout.c')
-rw-r--r--deps/cares/src/ares_timeout.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/deps/cares/src/ares_timeout.c b/deps/cares/src/ares_timeout.c
index 738ad15284..0b5a435f51 100644
--- a/deps/cares/src/ares_timeout.c
+++ b/deps/cares/src/ares_timeout.c
@@ -16,12 +16,10 @@
#include "ares_setup.h"
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
#endif
-#include <time.h>
-
#include "ares.h"
#include "ares_private.h"
@@ -67,8 +65,10 @@ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
*/
if (min_offset != -1)
{
- nextstop.tv_sec = min_offset/1000;
- nextstop.tv_usec = (min_offset%1000)*1000;
+ int ioffset = (min_offset > (long)INT_MAX) ? INT_MAX : (int)min_offset;
+
+ nextstop.tv_sec = ioffset/1000;
+ nextstop.tv_usec = (ioffset%1000)*1000;
if (!maxtv || ares__timedout(maxtv, &nextstop))
{