diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -97,7 +97,6 @@ #include #include #include -#include #include @@ -182,7 +181,7 @@ mntbuf->f_mntfromname, mntbuf->f_mntonname, buf); else if (errno == EPERM) - errx(1, "Only privileged users" + xo_errx(1, "Only privileged users" " can use the -m option"); } mntbuf++; @@ -255,7 +254,8 @@ xo_close_container("nfsstat"); } - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); exit(0); } @@ -513,8 +513,7 @@ static void usage(void) { - (void)fprintf(stderr, - "usage: nfsstat [-cdemszW] [-w wait]\n"); + xo_error("usage: nfsstat [-cdemszW] [-w wait]\n"); exit(1); } @@ -1139,7 +1138,7 @@ ext_nfsstatsp = &lastst; ext_nfsstatsp->vers = NFSSTATS_V1; if (nfssvc(NFSSVC_GETSTATS | NFSSVC_NEWSTRUCT, ext_nfsstatsp) < 0) - err(1, "Can't get stats"); + xo_err(1, "Can't get stats"); clock_gettime(CLOCK_MONOTONIC, &lastts); compute_totals(&lasttotal, ext_nfsstatsp); sleep(interval); @@ -1149,7 +1148,7 @@ ext_nfsstatsp->vers = NFSSTATS_V1; if (nfssvc(NFSSVC_GETSTATS | NFSSVC_NEWSTRUCT, ext_nfsstatsp) < 0) - err(1, "Can't get stats"); + xo_err(1, "Can't get stats"); clock_gettime(CLOCK_MONOTONIC, &ts); if (--hdrcnt == 0) {