Skip to content

Commit

Permalink
vmstat: Add root element to libxo output
Browse files Browse the repository at this point in the history
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
Pull Request: #1330

(cherry picked from commit c7dd97e)
  • Loading branch information
bramton authored and delphij committed Sep 10, 2024
1 parent 617a9b9 commit 5297156
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion usr.bin/vmstat/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static char sccsid[] = "@(#)vmstat.c 8.1 (Berkeley) 6/6/93";
#include <libutil.h>
#include <libxo/xo.h>

#define VMSTAT_XO_VERSION "1"
#define VMSTAT_XO_VERSION "2"

static char da[] = "da";

Expand Down Expand Up @@ -295,6 +295,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)
Expand Down Expand Up @@ -396,6 +397,7 @@ main(int argc, char *argv[])
dointr(interval, reps);
if (todo & VMSTAT)
dovmstat(interval, reps);
xo_close_container("vmstat");
xo_finish();
exit(0);
}
Expand Down

0 comments on commit 5297156

Please sign in to comment.