git: 71978fa41f2b - main - du: Add version information to libxo output
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 06 Sep 2024 18:35:12 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=71978fa41f2be0ecce7cb10d30242d29d4ccd844
commit 71978fa41f2be0ecce7cb10d30242d29d4ccd844
Author: Bram <bram@cbbg.nl>
AuthorDate: 2024-07-24 20:01:56 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-09-06 18:34:30 +0000
du: Add version information to libxo output
Add version information to libxo output so that
libxo content consumers can track changes.
Reviewed by: imp, markj
Pull Request: https://github.com/freebsd/freebsd-src/pull/1350
---
usr.bin/du/du.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
index 96ad7c037dfd..185a5cbe4465 100644
--- a/usr.bin/du/du.c
+++ b/usr.bin/du/du.c
@@ -55,6 +55,8 @@
#define UNITS_2 1
#define UNITS_SI 2
+#define DU_XO_VERSION "1"
+
static SLIST_HEAD(ignhead, ignentry) ignores;
struct ignentry {
char *mask;
@@ -259,6 +261,8 @@ main(int argc, char *argv[])
if ((fts = fts_open(argv, ftsoptions, NULL)) == NULL)
err(1, "fts_open");
+
+ xo_set_version(DU_XO_VERSION);
xo_open_container("disk-usage-information");
xo_open_list("paths");
while (errno = 0, (p = fts_read(fts)) != NULL) {