From nobody Thu Feb 09 20:40:42 2023 X-Original-To: dev-commits-src-all@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 4PCTK74SyKz3ndhx; Thu, 9 Feb 2023 20:40:43 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCTK71Wr4z3x2N; Thu, 9 Feb 2023 20:40:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975243; 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=82TA5mzASff6cWcpByUcgOcEdZynDNPRenHy9jR67Vs=; b=ZEwTqxD1HNqAdpUIWf2ug2eqnlj/eBr5hZ6ls57Q4il78ZrctgXF3z//8qG9nHTMNu7Cbf SE7fCaihUyacxtiUH5DmmU5S5x7gGrSP411UQD3U5Hk9sJxxBL+EqAuvLhdHaHKKl8IXo/ p5iYHcQDBZzJVsMoew05potN9EbuAg3ReObWF8IyyzBbEYyd/FHwFDV8cWlEynLg40iYzy sDOk4uRoxLCFww70jTKp7j2j1rgMDsNO6iuFfQghS+auTmkB+QUm4XxrKKjC8tU87LhTpG NUc7WKVxwkyQNa6MEysIOGPpec7biHCVXOg6fwJ6/RklWcc3Dpr03vMwprWTMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975243; 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=82TA5mzASff6cWcpByUcgOcEdZynDNPRenHy9jR67Vs=; b=vGsg20cLxIKO0gFRboasY6YjzogOp/eYMF66/2SW3WtcQ4SbXNMJMTc9W/bqhUIupK4urq TYpLDFVVKb0g2TV825ah+g8EQ4kfJmiXIxiD+PLRa7my3B0hDM+HaiBdbGzRBGZwSMaNBh YEjQHHtyEwKeBKTcMDHhbC/Vov3p2RPP/225Iizji3ahOH+Pokj350oaqc47MddOLTPeEk I0NKtdbVEBO2msfDhTO4Gd4+fe7tYmCFvkAKzf7Lr3qKEMSPyS45F3wOqryklzd0e9UMFK mV4A8zQFJsfeURJOtPl4qH7wnItCLwMb4TwWM12BoM4q/ic9cCUlaq7JF8YGNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675975243; a=rsa-sha256; cv=none; b=wE9JovXQZ41qToDXoPlW3OQauiFOSTrsNL8e7R80uyr2nUnKwY9R6n/pSVDxeNrToep7eF hzdM8fg3Z7kZt1ZMKx1ripTbHLh4xMFFJqhwJm9joJYQ2s/k43IWfDpZfNrE19K/dzI7PN 1e/W6/Jjlto6fH5bzY/RxLvcSUD87isuaEFDwiSLecpF4A/mNrhPoKQqXDP9ShWJHK4OMF IiTmnjYwbXue83pM01uGSnKpDb+f1JrQtxgoyOaqzUizY3+NGPaCX6jk+900AdaEzlpPy3 MB+goYrd3X97byj25aFbEdBEsaNuCfFtThlWo3lhSmTp2rEy3rIhZvQzItJGKw== 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 4PCTK70dsJzrGP; Thu, 9 Feb 2023 20:40:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319KegSI093941; Thu, 9 Feb 2023 20:40:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319KegGX093940; Thu, 9 Feb 2023 20:40:42 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:40:42 GMT Message-Id: <202302092040.319KegGX093940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: a6edc5b39209 - stable/13 - w: Complete libxo transition. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a6edc5b3920944ee42ba101214ada142c55f6301 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a6edc5b3920944ee42ba101214ada142c55f6301 commit a6edc5b3920944ee42ba101214ada142c55f6301 Author: Dag-Erling Smørgrav AuthorDate: 2023-01-25 06:21:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-09 20:32:56 +0000 w: Complete libxo transition. MFC after: 1 week Sponsred by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38172 (cherry picked from commit d90ff31ae5cd9ba073fbd6a7b2367b5209ea534e) w: Unlike err(3), xo_err(3) won't accept a null format string. MFC after: 1 week X-MFC-with: d90ff31ae5cd Sponsored by: Klara, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D38192 (cherry picked from commit 6fc1bbbf62bda2f1b5be3a4be3d36bc964490ebe) --- usr.bin/w/w.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index b06d605438ca..5ba9f49cdd35 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -67,7 +67,6 @@ static const char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94"; #include #include -#include #include #include #include @@ -189,7 +188,7 @@ main(int argc, char *argv[]) nflag += 1; break; case 'f': case 'l': case 's': case 'u': case 'w': - warnx("-%c no longer supported", ch); + xo_warnx("-%c no longer supported", ch); /* FALLTHROUGH */ case '?': default: @@ -204,7 +203,7 @@ main(int argc, char *argv[]) _res.retry = 1; /* only try once.. */ if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf)) == NULL) - errx(1, "%s", errbuf); + xo_errx(1, "%s", errbuf); (void)time(&now); @@ -239,7 +238,7 @@ main(int argc, char *argv[]) continue; } if ((ep = calloc(1, sizeof(struct entry))) == NULL) - errx(1, "calloc"); + xo_errx(1, "calloc"); *nextp = ep; nextp = &ep->next; memmove(&ep->utmp, utmp, sizeof *utmp); @@ -338,7 +337,8 @@ main(int argc, char *argv[]) pr_header(&now, nusers); if (wcmd == 0) { xo_close_container("uptime-information"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); (void)kvm_close(kd); exit(0); } @@ -351,7 +351,7 @@ main(int argc, char *argv[]) } if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL) - err(1, "%s", kvm_geterr(kd)); + xo_err(1, "%s", kvm_geterr(kd)); for (i = 0; i < nentries; i++, kp++) { if (kp->ki_stat == SIDL || kp->ki_stat == SZOMB || kp->ki_tdev == NODEV) @@ -397,7 +397,7 @@ main(int argc, char *argv[]) ep->args = fmt_argv(kvm_getargv(kd, ep->kp, argwidth), ep->kp->ki_comm, NULL, MAXCOMLEN); if (ep->args == NULL) - err(1, NULL); + xo_err(1, "fmt_argv"); } /* sort by idle time */ if (sortidle && ehead != NULL) { @@ -469,7 +469,8 @@ main(int argc, char *argv[]) xo_close_list("user-entry"); xo_close_container("user-table"); xo_close_container("uptime-information"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); (void)kvm_close(kd); exit(0);