mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-13 06:16:10 -04:00
Always round up when there's a fractional number of msecs.
This commit is contained in:
parent
850c3ff232
commit
8f9e60c825
2
evutil.c
2
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)
|
if (tv->tv_usec > 1000000 || tv->tv_sec > MAX_SECONDS_IN_MSEC_LONG)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return (tv->tv_sec * 1000) + (tv->tv_usec / 1000);
|
return (tv->tv_sec * 1000) + ((tv->tv_usec + 999) / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user