Refactor isc_time_now() to return time, and not result
The isc_time_now() and isc_time_now_hires() were used inconsistently through the code - either with status check, or without status check, or via TIME_NOW() macro with RUNTIME_CHECK() on failure. Refactor the isc_time_now() and isc_time_now_hires() to always fail when getting current time has failed, and return the isc_time_t value as return value instead of passing the pointer to result in the argument.
This commit is contained in:
@@ -166,8 +166,8 @@ isc_time_monotonic(void);
|
||||
* Returns the system's monotonic time in linear nanoseconds.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
isc_time_now(isc_time_t *t);
|
||||
isc_time_t
|
||||
isc_time_now(void);
|
||||
/*%<
|
||||
* Set 't' to the current absolute time.
|
||||
*
|
||||
@@ -185,8 +185,8 @@ isc_time_now(isc_time_t *t);
|
||||
* in the current definition of isc_time_t.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
isc_time_now_hires(isc_time_t *t);
|
||||
isc_time_t
|
||||
isc_time_now_hires(void);
|
||||
/*%<
|
||||
* Set 't' to the current absolute time. Uses higher resolution clocks
|
||||
* recommended when microsecond accuracy is required.
|
||||
|
||||
@@ -357,13 +357,6 @@ mock_assert(const int result, const char *const expression,
|
||||
FATAL_SYSERROR(ret, "%s()", #func); \
|
||||
}
|
||||
|
||||
/*%
|
||||
* Time
|
||||
*/
|
||||
#define TIME_NOW(tp) RUNTIME_CHECK(isc_time_now((tp)) == ISC_R_SUCCESS)
|
||||
#define TIME_NOW_HIRES(tp) \
|
||||
RUNTIME_CHECK(isc_time_now_hires((tp)) == ISC_R_SUCCESS)
|
||||
|
||||
/*%
|
||||
* Alignment
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user