From nobody Tue Mar 22 18:53:57 2022 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 74BF41A2B82D; Tue, 22 Mar 2022 18:53:58 +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 4KNLHT6yzTz3tMj; Tue, 22 Mar 2022 18:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647975238; 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=qqDUDKxpAqZKriVFgV4pW9VtVFswPpReLCUMRmgB298=; b=nwqcRvDl2V9ZazrubzkvjPVxA132kCzyJWFnurPy4H6yA5QcArDot9EVv0ijE2ddCrtfYz Px7CcQ1MU0TnpKSPZwZGVvQFSYuiZKG012UlIL6cIiKaRZcpZkteXrwtDfGcyOVgDWqS/e 3HMXd8OvZ5Jk3s15wBw1psavUOnRc2sXlEbZMKFBE9L4mi8q5+s4/rMcZAprb8isLP3lEj JMpWFUmeT1dhd0LbFGoouOjXkoMhnoTvU7KOT++nNcGofab7Ai4XDgvA1khV+8WZTPk8MV wv7psZcK1AxLyzDLuvqv0r8wPFb+dLeZAw+Bp0YkfrIChGZMbohYYW3qmT+iEQ== 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 A3FFB14EB4; Tue, 22 Mar 2022 18:53:57 +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 22MIrvAY099832; Tue, 22 Mar 2022 18:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22MIrv8I099831; Tue, 22 Mar 2022 18:53:57 GMT (envelope-from git) Date: Tue, 22 Mar 2022 18:53:57 GMT Message-Id: <202203221853.22MIrv8I099831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: a4bd2216fb52 - stable/13 - ps: fix `ps -aa` 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: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a4bd2216fb5250cee32ed9eb4090fc518018a26c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647975238; 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=qqDUDKxpAqZKriVFgV4pW9VtVFswPpReLCUMRmgB298=; b=L0bfI70cDHggOcE6spbnIW5OxRXTYqyURYHQt+TQNy4hpDmvdQdLfEj4+7BR74P0r4eGV7 o+RjVlIASapH4tw+PYWfQFqa/WX+ZTP08pwJdyz2HUP8E9B+vrDmDl5YHiJAdSqpVjVSsE c8N7rjgQk9mWJrapyfGTUnMpyJsyLmI5HJJftdm+pg3Pnyx0agW11rvqIPxWX4SLPV5L3y w5InN5A2rJCs2RZDgCFYkd28PybzAdBEVHcMLRCSFz283fQiGT9nXIhLLSM8yQYJNgDWZH jhHOglxNpKKIEOG4sjTjuyoSZc3j7vtLuTwRXTIkXHrcJffS20dVQxPIw224ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647975238; a=rsa-sha256; cv=none; b=uwGM5Stg86kZV0+xx+TBysuB4JMcUNH4mWJdgsgTHBLvUxyKctl/Ach5VtAB5S3m1NoZY2 MKiKQuXYJeNTswQe2/snTpC/qApl6tfGoE/TP4LJ/YNrN0tdoaWqTteOHDsYxns7nDSBBg gGOINZEgO6ao3xhANBmR/zM93hG2b1syQX0gkZzhgdyOmJmajAYmhVdJ+YCpgr+hyzAPmC zamkrYzCCD7svHPxxtZKUtUpF28p/4nXK3jbZz/nO8ZvRLf9+FJWweuqoiLZvGzi1388jF tD8KnIar+4rSXhqs8TfJUWIs+jEHl7UzuNTzeAX6Q7VPHcApS/V65YSbRfayQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=a4bd2216fb5250cee32ed9eb4090fc518018a26c commit a4bd2216fb5250cee32ed9eb4090fc518018a26c Author: Math Ieu AuthorDate: 2021-09-24 06:58:40 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2022-03-22 18:46:40 +0000 ps: fix `ps -aa` Passing the -a flag multiple times made ps show no processes. Differential Revision: https://reviews.freebsd.org/D27215 (cherry picked from commit bf27a2253f6ba6ee3086046b837b2fe40e22c72c) --- bin/ps/ps.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bin/ps/ps.c b/bin/ps/ps.c index d3cfc669d581..0c656d8a1544 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -253,11 +253,9 @@ main(int argc, char *argv[]) * added for compatibility with SUSv3, but for * now it will not be described in the man page. */ - nselectors++; all = xkeep = 1; break; case 'a': - nselectors++; all = 1; break; case 'C': @@ -473,7 +471,7 @@ main(int argc, char *argv[]) if (!_fmt) parsefmt(dfmt, 0); - if (nselectors == 0) { + if (!all && nselectors == 0) { uidlist.l.ptr = malloc(sizeof(uid_t)); if (uidlist.l.ptr == NULL) xo_errx(1, "malloc failed"); @@ -526,9 +524,6 @@ main(int argc, char *argv[]) what = KERN_PROC_UID | showthreads; flag = *uidlist.l.uids; nselectors = 0; - } else if (all) { - /* No need for this routine to select processes. */ - nselectors = 0; } }