Properly account del_extra_files and add the value to the json header.
authorclaudio <claudio@openbsd.org>
Fri, 26 May 2023 14:57:38 +0000 (14:57 +0000)
committerclaudio <claudio@openbsd.org>
Fri, 26 May 2023 14:57:38 +0000 (14:57 +0000)
OK tb@ (from a larger diff)

usr.sbin/rpki-client/main.c
usr.sbin/rpki-client/output-json.c

index 897b9a3..df16465 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: main.c,v 1.237 2023/05/25 12:52:56 claudio Exp $ */
+/*     $OpenBSD: main.c,v 1.238 2023/05/26 14:57:38 claudio Exp $ */
 /*
  * Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -755,6 +755,7 @@ sum_repostats(const struct repo *rp, const struct repostats *in, void *arg)
 
        out->del_files += in->del_files;
        out->extra_files += in->extra_files;
+       out->del_extra_files += in->del_extra_files;
        out->del_dirs += in->del_dirs;
        timespecadd(&in->sync_time, &out->sync_time, &out->sync_time);
 }
index 39f1cbd..f68872e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: output-json.c,v 1.37 2023/05/03 09:54:25 claudio Exp $ */
+/*     $OpenBSD: output-json.c,v 1.38 2023/05/26 14:57:38 claudio Exp $ */
 /*
  * Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
  *
@@ -73,8 +73,10 @@ outputheader_json(struct stats *st)
        json_do_int("vaps", st->repo_tal_stats.vaps);
        json_do_int("uniquevaps", st->repo_tal_stats.vaps_uniqs);
        json_do_int("cachedir_del_files", st->repo_stats.del_files);
-       json_do_int("cachedir_superfluous_files", st->repo_stats.extra_files);
        json_do_int("cachedir_del_dirs", st->repo_stats.del_dirs);
+       json_do_int("cachedir_superfluous_files", st->repo_stats.extra_files);
+       json_do_int("cachedir_del_superfluous_files",
+           st->repo_stats.del_extra_files);
 
        json_do_end();
 }