[PATCH] os: Actually use the computed clockid in GetTimeInMicros

Keith Packard keithp at keithp.com
Tue Nov 5 07:10:27 PST 2013


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 at debian.org>
Signed-off-by: Keith Packard <keithp at keithp.com>
---
 os/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/os/utils.c b/os/utils.c
index 995f62a..2aeb312 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -480,7 +480,7 @@ GetTimeInMicros(void)
         else
             clockid = ~0L;
     }
-    if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+    if (clock_gettime(clockid, &tp) == 0)
         return (CARD64) tp.tv_sec * (CARD64)1000000 + tp.tv_nsec / 1000;
 #endif
 
-- 
1.8.4.2



More information about the xorg-devel mailing list