]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Stop assuming time_t is long and represents seconds
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Fri, 29 Sep 2023 20:43:53 +0000 (14:43 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Fri, 29 Sep 2023 22:57:09 +0000 (16:57 -0600)
src/cache/local_cache.c
src/rtr/db/vrps.c

index b1683f11584ecc2934da9487037126506a9afefe..7a9493e7853975fcf7c52b43ff95bf25ca34a952 100644 (file)
@@ -814,25 +814,25 @@ node2json(struct cache_node *node)
 
        error = tt2json(node->ts_success, &date);
        if (error) {
-               pr_op_err("Cannot convert timestamp %ld to json: %s",
-                   node->ts_success, strerror(error));
+               pr_op_err("Cannot convert %s's success timestamp to json: %s",
+                   node->basename, strerror(error));
                goto cancel;
        }
        if (json_object_set_new(json, "ts_success", date)) {
-               pr_op_err("Cannot convert timestamp %ld to json; unknown cause.",
-                   node->ts_success);
+               pr_op_err("Cannot convert %s's success timestamp to json; unknown cause.",
+                   node->basename);
                goto cancel;
        }
 
        error = tt2json(node->ts_attempt, &date);
        if (error) {
-               pr_op_err("Cannot convert timestamp %ld to json: %s",
-                   node->ts_attempt, strerror(error));
+               pr_op_err("Cannot convert %s's attempt timestamp to json: %s",
+                   node->basename, strerror(error));
                goto cancel;
        }
        if (json_object_set_new(json, "ts_attempt", date)) {
-               pr_op_err("Cannot convert timestamp %ld to json; unknown cause.",
-                   node->ts_attempt);
+               pr_op_err("Cannot convert %s's attempt timestamp to json; unknown cause.",
+                   node->basename);
                goto cancel;
        }
 
index 0e5133df68ef8c08ecb7b4e0529b3f51544e93c9..3dd6876dc8861de327389c83902f0ac9f7686b8e 100644 (file)
@@ -382,7 +382,7 @@ vrps_update(bool *changed)
        if (config_get_mode() == SERVER)
                pr_op_info("- Serial: %u", serial);
        if (start != ((time_t) -1) && finish != ((time_t) -1))
-               pr_op_info("- Real execution time: %ld secs.", finish - start);
+               pr_op_info("- Real execution time: %.0lf secs.", difftime(finish, start));
 
        return error;
 }