diff options
author | Rickard Green <[email protected]> | 2016-06-15 16:57:08 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2016-06-15 16:57:08 +0200 |
commit | b97f18edd8896e441fc506e289eb04d2de48e5fa (patch) | |
tree | 18d07fe02602b2de990daf35de529721c38ca92f /erts/emulator/sys | |
parent | e3a07b08709bd7eacae0bcb0353c347475134ad7 (diff) | |
download | otp-b97f18edd8896e441fc506e289eb04d2de48e5fa.tar.gz otp-b97f18edd8896e441fc506e289eb04d2de48e5fa.tar.bz2 otp-b97f18edd8896e441fc506e289eb04d2de48e5fa.zip |
Fix mach clock usage on Sierra
Diffstat (limited to 'erts/emulator/sys')
-rw-r--r-- | erts/emulator/sys/unix/sys_time.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/erts/emulator/sys/unix/sys_time.c b/erts/emulator/sys/unix/sys_time.c index 60f8decd96..4f26639703 100644 --- a/erts/emulator/sys/unix/sys_time.c +++ b/erts/emulator/sys/unix/sys_time.c @@ -219,7 +219,10 @@ sys_init_time(ErtsSysInitTimeResult *init_resp) #endif init_resp->os_monotonic_time_info.resolution = (Uint64) 1000*1000*1000; -#if defined(HAVE_CLOCK_GETRES) && defined(MONOTONIC_CLOCK_ID) +#if defined(ERTS_HAVE_MACH_CLOCK_GETRES) && defined(MONOTONIC_CLOCK_ID) + init_resp->os_monotonic_time_info.resolution + = mach_clock_getres(&internal_state.r.o.mach.clock.monotonic); +#elif defined(HAVE_CLOCK_GETRES) && defined(MONOTONIC_CLOCK_ID) { struct timespec ts; if (clock_getres(MONOTONIC_CLOCK_ID, &ts) == 0) { @@ -229,9 +232,6 @@ sys_init_time(ErtsSysInitTimeResult *init_resp) init_resp->os_monotonic_time_info.resolution = 1; } } -#elif defined(ERTS_HAVE_MACH_CLOCK_GETRES) && defined(MONOTONIC_CLOCK_ID) - init_resp->os_monotonic_time_info.resolution - = mach_clock_getres(&internal_state.r.o.mach.clock.monotonic); #endif #ifdef MONOTONIC_CLOCK_ID_STR @@ -379,7 +379,10 @@ sys_init_time(ErtsSysInitTimeResult *init_resp) init_resp->os_system_time_info.locked_use = 0; init_resp->os_system_time_info.resolution = (Uint64) 1000*1000*1000; -#if defined(HAVE_CLOCK_GETRES) && defined(WALL_CLOCK_ID) +#if defined(ERTS_HAVE_MACH_CLOCK_GETRES) && defined(WALL_CLOCK_ID) + init_resp->os_system_time_info.resolution + = mach_clock_getres(&internal_state.r.o.mach.clock.wall); +#elif defined(HAVE_CLOCK_GETRES) && defined(WALL_CLOCK_ID) { struct timespec ts; if (clock_getres(WALL_CLOCK_ID, &ts) == 0) { @@ -389,9 +392,6 @@ sys_init_time(ErtsSysInitTimeResult *init_resp) init_resp->os_system_time_info.resolution = 1; } } -#elif defined(ERTS_HAVE_MACH_CLOCK_GETRES) && defined(WALL_CLOCK_ID) - init_resp->os_system_time_info.resolution - = mach_clock_getres(&internal_state.r.o.mach.clock.wall); #endif #if defined(OS_SYSTEM_TIME_USING_CLOCK_GETTIME) |