os: Actually use the computed clockid in GetTimeInMicros

The selection of which clock to use for this function was not actually
getting used when fetching the final clock value.

Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Julien Cristau 2013-11-05 07:08:21 -08:00 committed by Keith Packard
parent 903a058370
commit 5f1e832694

View File

@ -480,7 +480,7 @@ GetTimeInMicros(void)
else
clockid = ~0L;
}
if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
if (clockid != ~0L && clock_gettime(clockid, &tp) == 0)
return (CARD64) tp.tv_sec * (CARD64)1000000 + tp.tv_nsec / 1000;
#endif