]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
more time_t
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 27 Aug 2013 11:44:33 +0000 (11:44 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 27 Aug 2013 11:44:33 +0000 (11:44 +0000)
git-svn-id: file:///svn/unbound/trunk@2947 be551aaa-1e26-0410-a405-d3ace91eadb9

validator/autotrust.c

index 362f57a85eb01da5b9f2829ad0c565792b4dbb35..4be4fa3c7dbe5bd0316524e21aa444812966dbad 100644 (file)
@@ -1450,21 +1450,21 @@ update_events(struct module_env* env, struct val_env* ve,
  * @param holddown: the timer value
  * @return number of seconds the holddown has passed.
  */
-static int
-check_holddown(struct module_env* env, struct autr_ta* ta, 
+static time_t
+check_holddown(struct module_env* env, struct autr_ta* ta,
        unsigned int holddown)
 {
-        unsigned int elapsed;
-       if((unsigned)*env->now < (unsigned)ta->last_change) {
+        time_t elapsed;
+       if(*env->now < ta->last_change) {
                log_warn("time goes backwards. delaying key holddown");
                return 0;
        }
-       elapsed = (unsigned)*env->now - (unsigned)ta->last_change;
-        if (elapsed > holddown) {
-                return (int) (elapsed-holddown);
+       elapsed = *env->now - ta->last_change;
+        if (elapsed > (time_t)holddown) {
+                return elapsed-(time_t)holddown;
         }
-       verbose_key(ta, VERB_ALGO, "holddown time %d seconds to go",
-               (int) (holddown-elapsed));
+       verbose_key(ta, VERB_ALGO, "holddown time %lld seconds to go",
+               (long long) ((time_t)holddown-elapsed));
         return 0;
 }