dibbler
dibbler copied to clipboard
fix misguided (and broken) usage of clock_gettime(CLOCK_MONOTONIC_RAW, ...)
-
Fix bugs introduced by a copy and paste mistakes (assignment to the wrong variable if the call to clock_gettime() succeeds in TAddrIA::getT2Timeout() and the addition of bogus calls to this->setTimestamp(ts) (ie calls which were not there in the original code and not related to the change from time() to clock_gettime()) in TAddrIA::getT1Timeout() and TAddrIA::getT2Timeout()
-
Replace CLOCK_MONOTONIC_RAW with CLOCK_MONOTONIC. For the purpose of replacing time() (ie resolution of seconds), there's no clear reason to use CLOCK_MONOTONIC_RAW with clock_gettime() instead of the more widely supported CLOCK_MONOTONIC. The incremental adjustments performed by adjtime() and NTP are limited to small changes which should not effect timers, timeouts, etc measured in seconds.
-
Avoid needlessly calling both time() and clock_gettime()