summaryrefslogtreecommitdiffstats
path: root/usr.bin/dig/lib/isc/timer.c
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2020-02-16 21:06:15 +0000
committerflorian <florian@openbsd.org>2020-02-16 21:06:15 +0000
commit396be90974e3f4ba4e470cc88584f036d03c4475 (patch)
tree8a781e13666ce2e29c36c4daf850c6fcd73272d0 /usr.bin/dig/lib/isc/timer.c
parentThe timer type we are using requires interval to be set, remove (diff)
downloadwireguard-openbsd-396be90974e3f4ba4e470cc88584f036d03c4475.tar.xz
wireguard-openbsd-396be90974e3f4ba4e470cc88584f036d03c4475.zip
Reduce interval indirection by setting struct members directly and
using macros from sys/time.h OK millert
Diffstat (limited to 'usr.bin/dig/lib/isc/timer.c')
-rw-r--r--usr.bin/dig/lib/isc/timer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/dig/lib/isc/timer.c b/usr.bin/dig/lib/isc/timer.c
index 412918e3df8..d6c1ea8777f 100644
--- a/usr.bin/dig/lib/isc/timer.c
+++ b/usr.bin/dig/lib/isc/timer.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: timer.c,v 1.12 2020/02/16 21:04:44 florian Exp $ */
+/* $Id: timer.c,v 1.13 2020/02/16 21:06:15 florian Exp $ */
/*! \file */
@@ -221,7 +221,7 @@ isc__timer_create(isc_timermgr_t *manager0, const struct timespec *interval,
REQUIRE(task != NULL);
REQUIRE(action != NULL);
REQUIRE(interval != NULL);
- REQUIRE(!(interval_iszero(interval)));
+ REQUIRE(timespecisset(interval));
REQUIRE(timerp != NULL && *timerp == NULL);
/*
@@ -236,7 +236,7 @@ isc__timer_create(isc_timermgr_t *manager0, const struct timespec *interval,
timer->manager = manager;
timer->references = 1;
- if (!interval_iszero(interval)) {
+ if (timespecisset(interval)) {
result = isc_time_add(&now, interval, &timer->idle);
if (result != ISC_R_SUCCESS) {
free(timer);
@@ -300,7 +300,7 @@ isc__timer_reset(isc_timer_t *timer0, const struct timespec *interval,
manager = timer->manager;
REQUIRE(VALID_MANAGER(manager));
REQUIRE(interval != NULL);
- REQUIRE(!(interval_iszero(interval)));
+ REQUIRE(timespecisset(interval));
/*
* Get current time.
@@ -314,7 +314,7 @@ isc__timer_reset(isc_timer_t *timer0, const struct timespec *interval,
ISC_TIMEREVENT_LASTEVENT,
NULL);
timer->interval = *interval;
- if (!interval_iszero(interval)) {
+ if (timespecisset(interval)) {
result = isc_time_add(&now, interval, &timer->idle);
} else {
isc_time_settoepoch(&timer->idle);