提交 1e21db80 authored 作者: Michael Jerris's avatar Michael Jerris

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
上级 e34e139f
......@@ -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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论