From 06aa92f52c92cf8a2b57f6557de8ad3c46bf7b5c Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Sun, 17 Jan 2016 22:17:21 +0200 Subject: [PATCH] Fix compilation of rtl_test.c on Mac OS X --- src/rtl_test.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rtl_test.c b/src/rtl_test.c index 1f9dda1..1afbb9f 100644 --- a/src/rtl_test.c +++ b/src/rtl_test.c @@ -152,9 +152,10 @@ static void underrun_test(unsigned char *buf, uint32_t len, int mute) static int ppm_gettime(struct time_generic *tg) { int rv = ENOSYS; - struct timespec ts; #ifdef __unix__ + struct timespec ts; + rv = clock_gettime(CLOCK_MONOTONIC, &ts); tg->tv_sec = ts.tv_sec; tg->tv_nsec = ts.tv_nsec; @@ -162,8 +163,8 @@ static int ppm_gettime(struct time_generic *tg) struct timeval tv; rv = gettimeofday(&tv, NULL); - ts->tv_sec = tv.tv_sec; - ts->tv_nsec = tv.tv_usec * 1000; + tg->tv_sec = tv.tv_sec; + tg->tv_nsec = tv.tv_usec * 1000; #endif return rv; }