From nobody Sat Oct 12 18:30:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQsVk2FLvz5YnYx; Sat, 12 Oct 2024 18:30:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQsVk00wlz4DwR; Sat, 12 Oct 2024 18:30:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728757822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pt2WUTDEpXAbqXwIo7l0GDGxCcA75dilVDvrK+EbPoY=; b=JSSPKy69izm9r1Mby7rfeVoAx8IZ4U1A2FckFkr/1W0GmkEwu++aL0/cy47FysAvQGFgDl a00USHyGlV5WmtLZsGFClfvK0fbZnVRsrQUG7TemuXZYeA6InsIkkUa3YNLre/5Rb7bmOi UrpOlBbAE9UFbOHSYnhWIwGfyRBBlGB6lsqQPWcdBk+DLXCUx3XUXvUlDMuVzIIw4A5tGU 4EfuTms4E7uxxfYufqseF7gAdsc2tgcdmTZeTJMDpV1axwXoHUrR6IFdBbw+hb/xq9oATM 9OQKLWSLSuZw5m8apAu4oUxvFO2NlvqFz7mcVa5SdvWL7MbJKI2wJUw3RkbEaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728757822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pt2WUTDEpXAbqXwIo7l0GDGxCcA75dilVDvrK+EbPoY=; b=cg6z6bNHq2ij0G057iXOnWpGSx27d97ULfaBr73X21vLU4fKGixBiuH2CeFdwfIL4inooq sAtNDyLfrRiPttIH5X8evprEsInAa0RwIOiQQPsU3Umb/EsXZ6TeEltVbDsVq+YbLO7OyJ ywHJ9dUGfOlXhlSL/EubJaa/qiBBvbISQqzyFK0Gz7/iSXN0nFLuKjqHlXiur+aU2dTPxd 2/JQAXE90iMSi3tOk14XP4wszu6gk4hkdU9ESlWoLmhckIFwSVyQqaX48LBECVStehadk0 SuR9feoCv6VJguClmjrzKtn4+BW27j2BDqZdmyWqlPQY957FTSKBXhqGkvD58w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728757822; a=rsa-sha256; cv=none; b=YIN9zoh4jaRiVAMULH4X/FMPQOBiYdGCgh0W5LFKl5LRgKXLC5nydQHhC1UQ7ut21PzjsI Ep4K0RBaU0K69PvkLEVEbi8OpaHl9EDmUeDv5cXSWJbntsTyRhGIzyNf8kjMAJKiK6s3Uf g3idjJvr9JS1csA2fQNTqsnCokB6GLNRvhyzrcGo2jUm8AxUjkvS/p+b3TdIBZOSAtMR2b 8qJ3Q2BL/eXESnGZqsblcPIuISVOOKN2Na0OWMO/Y/6e7PWpohR68UGXyG2DwE+pUMlMqB Qji5BMP0vgSORkktkbOn2SLX1SlibUn4eq2dktKXBiae8oE10Cx2gKsdIB9dMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQsVj67jJzLkW; Sat, 12 Oct 2024 18:30:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49CIULaL092335; Sat, 12 Oct 2024 18:30:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49CIULTM092332; Sat, 12 Oct 2024 18:30:21 GMT (envelope-from git) Date: Sat, 12 Oct 2024 18:30:21 GMT Message-Id: <202410121830.49CIULTM092332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: b698093da430 - main - nfsstat(1): Complete libxo transition List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b698093da430bb25ee2cdf6346472aac91559b25 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=b698093da430bb25ee2cdf6346472aac91559b25 commit b698093da430bb25ee2cdf6346472aac91559b25 Author: Yan-Hao Wang AuthorDate: 2024-10-12 15:17:23 +0000 Commit: Li-Wen Hsu CommitDate: 2024-10-12 18:21:47 +0000 nfsstat(1): Complete libxo transition Reviewed by: des MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41428 --- usr.bin/nfsstat/nfsstat.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index 55f5573662c7..20472cf4a129 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -83,7 +83,6 @@ #include #include #include -#include #include @@ -168,7 +167,7 @@ main(int argc, char **argv) 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++; @@ -241,7 +240,8 @@ main(int argc, char **argv) xo_close_container("nfsstat"); } - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); exit(0); } @@ -505,8 +505,7 @@ printhdr(int clientOnly, int serverOnly, int newStats) static void usage(void) { - (void)fprintf(stderr, - "usage: nfsstat [-cdEemqszW] [-w wait]\n"); + xo_error("usage: nfsstat [-cdEemqszW] [-w wait]\n"); exit(1); } @@ -1131,7 +1130,7 @@ exp_sidewaysintpr(u_int interval, int clientOnly, int serverOnly, 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); @@ -1141,7 +1140,7 @@ exp_sidewaysintpr(u_int interval, int clientOnly, int serverOnly, 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) {