From nobody Sat Oct 12 18:30:18 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 4XQsVf5r6Nz5YnnY; Sat, 12 Oct 2024 18:30:18 +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 4XQsVf465Nz4Dxy; Sat, 12 Oct 2024 18:30:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728757818; 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=iF9xnee99UkqkpU4vfyuDPVIgxJ32+X20XL8XNUKD4Y=; b=e9hhDCytzvFhdXjsBue+nDlNkwOskuPYctr9pMRXkZqpCyhexbWguS4zsLnK3v2xNe918d Os/SUmhe6W1tqWSeZ+v9mSzyIvIAW8jhvO3O+E61S6y9G3zKlz1FCkWAoG3U1J2wE0EEHt P7nPI7aiU1YVmlaiHEpgtSOch8Tmk4dXbg6rPR5rrSb/UQC+9BDUcQJs9I1bL06pZ/YKNs n7peWd+0Hbzc5Ti4UPqlv32eb4Oxz5/WadvvXk7EIdD9MPbST4D/qIdW/8zfxyc/0ElBRX H0aBzD/Sx//sA/liceJpg/hWdSEJOl7Akv+FxJb7KpPiWteqYS8ozf0sIqMEmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728757818; 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=iF9xnee99UkqkpU4vfyuDPVIgxJ32+X20XL8XNUKD4Y=; b=TI7e/zgCABkRbpvya3jcetaJDwiEHY9x0iLn2614/gjWipN9rYbFkGKRHlRzIaO1Nl371y lKFc+SnuwiUY5A49iWwhJYnhRMj4S982mbtdEUQm4dowgt3UPA2pZFsxXnpiZYAKRCu/ZW Um8qUZip3L1JTiGVjjCN/oDEfv/QigZlUiPyHX+tsRNqDNuSZGE1DiGp4i2fpuFOBrmFcv FizcddBCKBHt6XO2x14trtZd5ZXgTwEhTFzbOaKdAme3Es4pXivdN0ZavAiQ9V7SkrxwNz kIo1wBM8XTC0OspVSKoqf+mmLjcbihR0H33QKlS2/7dm8ZzWy/AUBxWpmx3fgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728757818; a=rsa-sha256; cv=none; b=qcI5TgzbJmuWbJR9StlHKLNbfuiMVuTgSEYTyDx4mm74qeramp8qdbSBMC3EdSkTsH83Ot SadVxWkUCGeHO0hGbCqx69izwiBws7vxL9z+FVZZ9ihmKpOz/dC+L9vxLAPQvuO2JK8ZEy 7+p4J6vJQlYzJKrJHbc8FHEOl99tUJukjyc6TrCbX/MQx5Azde1ECNPzehOJj6xxivqsQI 5mCGwFtbBJof0nFF71AoiH6h/8SNs/AONns2bbj9KlV0RHwnIq6LOnh+fxHmgSnprU9DQt BSL0FSu4aau46TRN4Udk0Y0a08AOWlv0jVxhB7RLbXUDgd+I9wmvYVegaCvjwQ== 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 4XQsVf3clDzLmv; Sat, 12 Oct 2024 18:30:18 +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 49CIUIeo092210; Sat, 12 Oct 2024 18:30:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49CIUIe6092207; Sat, 12 Oct 2024 18:30:18 GMT (envelope-from git) Date: Sat, 12 Oct 2024 18:30:18 GMT Message-Id: <202410121830.49CIUIe6092207@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: e17a2944a6e0 - main - ps(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: e17a2944a6e08478b9c073ba62c46f6714af16a2 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=e17a2944a6e08478b9c073ba62c46f6714af16a2 commit e17a2944a6e08478b9c073ba62c46f6714af16a2 Author: Yan-Hao Wang AuthorDate: 2024-10-12 15:06:59 +0000 Commit: Li-Wen Hsu CommitDate: 2024-10-12 18:21:46 +0000 ps(1): Complete libxo transition Reviewed by: des MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41422 --- bin/ps/keyword.c | 14 +++++++------- bin/ps/print.c | 1 - bin/ps/ps.c | 13 +++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c index 82c08d3e75f1..a03f91ec2831 100644 --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -250,7 +249,8 @@ showkey(void) } xo_emit("\n"); xo_close_list("key"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); } void @@ -291,7 +291,7 @@ parsefmt(const char *p, int user) continue; } if ((vent = malloc(sizeof(struct varent))) == NULL) - errx(1, "malloc failed"); + xo_errx(1, "malloc failed"); vent->header = v->header; if (hp) { hp = strdup(hp); @@ -300,13 +300,13 @@ parsefmt(const char *p, int user) } vent->var = malloc(sizeof(*vent->var)); if (vent->var == NULL) - errx(1, "malloc failed"); + xo_errx(1, "malloc failed"); memcpy(vent->var, v, sizeof(*vent->var)); STAILQ_INSERT_TAIL(&varlist, vent, next_ve); } free(tempstr1); if (STAILQ_EMPTY(&varlist)) { - warnx("no valid keywords; valid keywords:"); + xo_warnx("no valid keywords; valid keywords:"); showkey(); exit(1); } @@ -345,7 +345,7 @@ findvar(char *p, int user, char **header) rflen = strlen(v->alias) + strlen(hp) + 2; realfmt = malloc(rflen); if (realfmt == NULL) - errx(1, "malloc failed"); + xo_errx(1, "malloc failed"); snprintf(realfmt, rflen, "%s=%s", v->alias, hp); parsefmt(realfmt, user); free(realfmt); @@ -353,7 +353,7 @@ findvar(char *p, int user, char **header) return ((VAR *)NULL); } if (!v) { - warnx("%s: keyword not found", p); + xo_warnx("%s: keyword not found", p); eval = 1; } if (header) diff --git a/bin/ps/print.c b/bin/ps/print.c index fc6f7ab25428..a3423d8b3956 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -40,7 +40,6 @@ #include #include -#include #include #include #include diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 53ace6247b33..b0af2bdf37ca 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -46,7 +46,6 @@ #include #include -#include #include #include #include @@ -657,7 +656,8 @@ main(int argc, char *argv[]) if (nkept == 0) { printheader(); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); exit(1); } @@ -742,7 +742,8 @@ main(int argc, char *argv[]) } xo_close_list("process"); xo_close_container("process-information"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); free_list(&gidlist); free_list(&jidlist); @@ -812,14 +813,14 @@ addelem_jid(struct listinfo *inf, const char *elem) int tempid; if (*elem == '\0') { - warnx("Invalid (zero-length) jail id"); + xo_warnx("Invalid (zero-length) jail id"); optfatal = 1; return (0); /* Do not add this value. */ } tempid = jail_getid(elem); if (tempid < 0) { - warnx("Invalid %s: %s", inf->lname, elem); + xo_warnx("Invalid %s: %s", inf->lname, elem); optfatal = 1; return (0); } @@ -1480,7 +1481,7 @@ usage(void) { #define SINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]" - (void)xo_error("%s\n%s\n%s\n%s\n%s\n", + xo_error("%s\n%s\n%s\n%s\n%s\n", "usage: ps [--libxo] " SINGLE_OPTS " [-O fmt | -o fmt]", " [-G gid[,gid...]] [-J jid[,jid...]] [-M core] [-N system]", " [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]",