0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2000, 2001, 2004, 2005, 2007, 2016 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * file, You can obtain one at http://mozilla.org/MPL/2.0/.
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater/* $Id: timer.c,v 1.7 2007/06/19 23:47:16 tbox Exp $ */
d8f90196479e065286428dd8cbd1615d0f105f8cAndreas Gustafsson if (result != ISC_R_SUCCESS) goto failure; \
d8f90196479e065286428dd8cbd1615d0f105f8cAndreas Gustafssondns_timer_setidle(isc_timer_t *timer, unsigned int maxtime,
d8f90196479e065286428dd8cbd1615d0f105f8cAndreas Gustafsson unsigned int idletime, isc_boolean_t purge)
d8f90196479e065286428dd8cbd1615d0f105f8cAndreas Gustafsson isc_interval_t maxinterval, idleinterval;
d8f90196479e065286428dd8cbd1615d0f105f8cAndreas Gustafsson /* Compute the time of expiry. */
d8f90196479e065286428dd8cbd1615d0f105f8cAndreas Gustafsson isc_interval_set(&maxinterval, maxtime, 0);
d8f90196479e065286428dd8cbd1615d0f105f8cAndreas Gustafsson CHECK(isc_time_nowplusinterval(&expires, &maxinterval));
d8f90196479e065286428dd8cbd1615d0f105f8cAndreas Gustafsson * Compute the idle interval, and add a spare nanosecond to
d8f90196479e065286428dd8cbd1615d0f105f8cAndreas Gustafsson * work around the silly limitation of the ISC timer interface
d8f90196479e065286428dd8cbd1615d0f105f8cAndreas Gustafsson * that you cannot specify an idle interval of zero.
d8f90196479e065286428dd8cbd1615d0f105f8cAndreas Gustafsson isc_interval_set(&idleinterval, idletime, 1);