From: Alberto Leiva Popper Date: Fri, 29 Sep 2023 20:43:53 +0000 (-0600) Subject: Stop assuming time_t is long and represents seconds X-Git-Tag: 1.6.0~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c6479925ab591f4771d5c4da2239df86198707c;p=thirdparty%2FFORT-validator.git Stop assuming time_t is long and represents seconds --- diff --git a/src/cache/local_cache.c b/src/cache/local_cache.c index b1683f11..7a9493e7 100644 --- a/src/cache/local_cache.c +++ b/src/cache/local_cache.c @@ -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; } diff --git a/src/rtr/db/vrps.c b/src/rtr/db/vrps.c index 0e5133df..3dd6876d 100644 --- a/src/rtr/db/vrps.c +++ b/src/rtr/db/vrps.c @@ -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; }