From: Michael Jerris Date: Sun, 23 Mar 2008 00:22:18 +0000 (+0000) Subject: deal with linux platforms that have clock_gettime but don't define CLOCK_MONOTONIC... X-Git-Tag: v1.0-rc2~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e21db8022d0fa5db411ff7fca7874743fc0cee3;p=thirdparty%2Ffreeswitch.git deal with linux platforms that have clock_gettime but don't define CLOCK_MONOTONIC. (FSCORE-111) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7950 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/switch_time.c b/src/switch_time.c index 5f9ea90b22..f9bc7f22d4 100644 --- a/src/switch_time.c +++ b/src/switch_time.c @@ -95,7 +95,7 @@ SWITCH_DECLARE(time_t) switch_timestamp(time_t *t) return now; } -#if defined(HAVE_CLOCK_GETTIME) +#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) static int MONO = 1; #else static int MONO = 0; @@ -105,7 +105,7 @@ static switch_time_t time_now(int64_t offset) { switch_time_t now; -#if defined(HAVE_CLOCK_GETTIME) +#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) if (MONO) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); @@ -114,7 +114,7 @@ static switch_time_t time_now(int64_t offset) #endif now = switch_time_now(); -#if defined(HAVE_CLOCK_GETTIME) +#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) } #endif