git: 5321a3547912 - main - w: Add version information to libxo output
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 06 Sep 2024 18:35:15 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=5321a3547912acbeea7eaea8ec3ed85f07537469
commit 5321a3547912acbeea7eaea8ec3ed85f07537469
Author: Bram <bram@cbbg.nl>
AuthorDate: 2024-07-26 19:35:57 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-09-06 18:34:31 +0000
w: 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/w/w.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 8bce6d8427e6..47899d0b38e0 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -108,6 +108,8 @@ static struct entry {
#define debugproc(p) *(&((struct kinfo_proc *)p)->ki_udata)
+#define W_XO_VERSION "1"
+
#define W_DISPUSERSIZE 10
#define W_DISPLINESIZE 8
#define W_MAXHOSTSIZE 40
@@ -317,6 +319,7 @@ main(int argc, char *argv[])
if (fromwidth > W_MAXHOSTSIZE)
fromwidth = W_MAXHOSTSIZE;
+ xo_set_version(W_XO_VERSION);
xo_open_container("uptime-information");
if (header || wcmd == 0) {