mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-27 18:40:07 +01:00
GetTimeInMillis: use correct units for clock_gettime
Make sure we're treating the nanoseconds as a long, not an int, so we don't overflow.
This commit is contained in:
parent
51a06b3c44
commit
68f595ca6c
1 changed files with 1 additions and 1 deletions
|
|
@ -552,7 +552,7 @@ GetTimeInMillis(void)
|
|||
#ifdef MONOTONIC_CLOCK
|
||||
struct timespec tp;
|
||||
if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
|
||||
return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000);
|
||||
return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
|
||||
#endif
|
||||
|
||||
X_GETTIMEOFDAY(&tv);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue