From 8f9e60c825768c6dbc22fb6a2874b1f47cb34287 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 9 Apr 2010 19:16:09 -0700 Subject: [PATCH] Always round up when there's a fractional number of msecs. --- evutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evutil.c b/evutil.c index 3ca9fef9..b75a4697 100644 --- a/evutil.c +++ b/evutil.c @@ -1904,6 +1904,6 @@ evutil_tv_to_msec(const struct timeval *tv) if (tv->tv_usec > 1000000 || tv->tv_sec > MAX_SECONDS_IN_MSEC_LONG) return -1; - return (tv->tv_sec * 1000) + (tv->tv_usec / 1000); + return (tv->tv_sec * 1000) + ((tv->tv_usec + 999) / 1000); } -- 2.40.0