mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-25 01:55:19 +01:00
vmstat: Add root element to libxo output
Current libxo output does not have a root element. Valid XML requires a single root element. This commit adds this root element. The libxo output version bumped accordingly. PR: 254635 MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1330
This commit is contained in:
parent
b162fc3f30
commit
c7dd97ec99
@ -66,7 +66,7 @@
|
||||
#include <libutil.h>
|
||||
#include <libxo/xo.h>
|
||||
|
||||
#define VMSTAT_XO_VERSION "1"
|
||||
#define VMSTAT_XO_VERSION "2"
|
||||
|
||||
static char da[] = "da";
|
||||
|
||||
@ -282,6 +282,7 @@ main(int argc, char *argv[])
|
||||
argv += optind;
|
||||
|
||||
xo_set_version(VMSTAT_XO_VERSION);
|
||||
xo_open_container("vmstat");
|
||||
if (!hflag)
|
||||
xo_set_options(NULL, "no-humanize");
|
||||
if (todo == 0)
|
||||
@ -383,6 +384,7 @@ nlist_ok:
|
||||
dointr(interval, reps);
|
||||
if (todo & VMSTAT)
|
||||
dovmstat(interval, reps);
|
||||
xo_close_container("vmstat");
|
||||
xo_finish();
|
||||
exit(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user