Skip to content

Commit

Permalink
Fix clock_t crash on iOS 9.3.2 and 9.3.5 (#2325)
Browse files Browse the repository at this point in the history
* Fix possible clock_t crash on iOS 9.3.2 and 9.3.5 + macOS < 10.12

* No need to read return value
  • Loading branch information
azawawi authored and bluca committed Jan 26, 2017
1 parent c6c21cf commit bf6d8a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ uint64_t zmq::clock_t::rdtsc ()
return(tsc);
#else
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
#if defined ZMQ_HAVE_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 // less than macOS 10.12
alt_clock_gettime (CLOCK_MONOTONIC, &ts);
#else
clock_gettime (CLOCK_MONOTONIC, &ts);
#endif
return (uint64_t)(ts.tv_sec) * 1000000000 + ts.tv_nsec;
#endif
}

0 comments on commit bf6d8a5

Please sign in to comment.