Commit e72c1e7e authored by Mark Andrews's avatar Mark Andrews

2430. [bug] win32: isc_interval_set() could round down to

                        zero if the input was less than NS_INTERVAL
                        nanoseconds.  Round up instead. [RT #18549]
parent 3857cb6f
2430. [bug] win32: isc_interval_set() could round down to
zero if the input was less than NS_INTERVAL
nanoseconds. Round up instead. [RT #18549]
2429. [doc] nsupdate should be in section 1 of the man pages.
[RT #18283]
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: time.c,v 1.43 2007/06/19 23:47:19 tbox Exp $ */
/* $Id: time.c,v 1.44 2008/08/29 03:57:38 marka Exp $ */
#include <config.h>
......@@ -64,8 +64,11 @@ isc_interval_set(isc_interval_t *i, unsigned int seconds,
REQUIRE(i != NULL);
REQUIRE(nanoseconds < NS_PER_S);
/*
* This rounds nanoseconds up not down.
*/
i->interval = (LONGLONG)seconds * INTERVALS_PER_S
+ nanoseconds / NS_INTERVAL;
+ (nanoseconds + NS_INTERVAL - 1) / NS_INTERVAL;
}
isc_boolean_t
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment