fix for os x build
authorCharlie Lenahan <charlie.lenahan@intel.com>
Mon, 13 Apr 2015 21:26:28 +0000 (17:26 -0400)
committerErich Keane <erich.keane@intel.com>
Mon, 13 Apr 2015 22:23:44 +0000 (22:23 +0000)
This is a followup to https://gerrit.iotivity.org/gerrit/#/c/677/
Apple defines _POSIX_TIMERS as (-1) , thus the need to check for
both

Change-Id: I8a852febd45133177706a1d529040fce704200f9
Signed-off-by: Charlie Lenahan <charlie.lenahan@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/706
Reviewed-by: Thuyen Tran <thuyen.c.tran@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/logger/src/logger.c

index 8f4e809..b642464 100644 (file)
@@ -130,7 +130,7 @@ static void osalGetTime(int *min,int *sec, int *ms)
 {
     if (min && sec && ms)
     {
-#ifdef _POSIX_TIMERS
+#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0
         struct timespec when = {};
         clockid_t clk = CLOCK_REALTIME;
 #ifdef CLOCK_REALTIME_COARSE