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,7 @@ #include #include #include -#include + #include @@ -158,7 +158,7 @@ argc = xo_parse_args(argc, argv); if (argc < 0) - exit(1); + exit(EXIT_FAILURE); xo_set_version(NFSSTAT_XO_VERSION); @@ -182,12 +182,12 @@ 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++; } - exit(0); + exit(EXIT_SUCCESS); case 'N': printf("*** -N option deprecated, ignored\n\n"); break; @@ -255,8 +255,9 @@ xo_close_container("nfsstat"); } - xo_finish(); - exit(0); + if (xo_finish() < 0) + xo_err(EXIT_FAILURE, "stdout"); + exit(EXIT_SUCCESS); } /* @@ -515,7 +516,7 @@ { (void)fprintf(stderr, "usage: nfsstat [-cdemszW] [-w wait]\n"); - exit(1); + exit(EXIT_FAILURE); } static char SPBuf[64][8]; @@ -1139,7 +1140,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 +1150,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) {