From nobody Thu Aug 24 16:37:09 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 4RWpdd2jK9z4rLk6; Thu, 24 Aug 2023 16:37:09 +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 4RWpdd257Vz4S0C; Thu, 24 Aug 2023 16:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692895029; 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=NwKjSLgukKLKdCPcHFDPSWDPlpJmtWKcLL5XybTwF3Q=; b=WWxnOmFzUClSV6eV//cuHQ2Ct15mvgC8aSI4lTO7tO1pjMiB28za7ogXxzku6e04H19s/s iIIsaQu1frKsUMUw+Zj6ix7mArwEyxijQe3MYZbaQmYDrwLzuZY9H4tcLWeZ6RGP35SHox g+vX4A8F/19m4gN8HF8UzPPBUH9n1H8fcWueMniFPWgiXAhWxU612NANAMbzWuO1RaVg6M 28wRb+MBp8xgln55zN5SqYTVuiHNuYmDkzK5lwdFBSTkuXFjn3O0+bu/3cAxPEONzIAIZV 2bN8YlRYLVjxGX8xpWZ+cvn4o/AA3P80LkSJRJ5qLt8OjaiGhaPc14kE6hV8Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692895029; 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=NwKjSLgukKLKdCPcHFDPSWDPlpJmtWKcLL5XybTwF3Q=; b=anQbb1ya50VTpnUW6jMn6Zkw8tGUZboesCnO5qIw0x5RC5MLeADnxyAdbA1ivpmhP7OnzZ o6SZF0aCtqDzkuJ1kY5PxosCHDcEsdVePUmcjpfe1buMg0yFrq0CYGOKscezkS3z05jzoW 22GmeMWUb7NGGX+hfQx5epvWCMvcmUUB0t99IC7rP0XU8CbEw0LIuETR8d/UCX8zGSh3Rt WJ2ggQMHX6xHR6koVcwZMr9fUBcY2EVRMfShK0W+PU0l04pVFqaomZxo+FJu1zK7T8vqA0 ONa96E6+FCbw1uiXCA9Jgra5S60jDtG9tIF+dxNrHp4+kE+5ePnOl0n3+qzZ3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692895029; a=rsa-sha256; cv=none; b=PDblLju1rVrSpyByG7jz/cGLpLRHccxG8RNN5WqsVVdpRKfQ8K5g5pgV9xVSvCL3aUFOjg 6wOyEcQmos0T7CVWMnJCDgFjwUADsorkG7f/05o1pi3qDtaG50WFMBTjqHuW5HYCRK9ZX/ 9dstsfSs4ELl7KbYLlXQuZsKr/XeEmu/G+77FheK/DJK64Z/m+u5eV57fUoLhM7cT/vMg6 jO5YgpVih/PPHtjigXwEhmL46RjA5nWaAfMc3CSyaPyoWYRICLBMTpKKhQf/6qHMkOsM/R /VtK1ENeyQB3B8+hOf48u00t1DbsADhA9afUCodoe4uSeheKZrhSusEc7gm2Gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RWpdd17m7zZKV; Thu, 24 Aug 2023 16:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37OGb90H011103; Thu, 24 Aug 2023 16:37:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37OGb95M011100; Thu, 24 Aug 2023 16:37:09 GMT (envelope-from git) Date: Thu, 24 Aug 2023 16:37:09 GMT Message-Id: <202308241637.37OGb95M011100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: f06e32e9b9e4 - main - Revert "ps: extend the non-standard option -d (tree view) to work with -p" 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/main X-Git-Reftype: branch X-Git-Commit: f06e32e9b9e4eef24df12db1b2d659893b02d4cd Auto-Submitted: auto-generated The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=f06e32e9b9e4eef24df12db1b2d659893b02d4cd commit f06e32e9b9e4eef24df12db1b2d659893b02d4cd Author: Piotr Pawel Stefaniak AuthorDate: 2023-07-29 16:16:35 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2023-08-24 16:35:50 +0000 Revert "ps: extend the non-standard option -d (tree view) to work with -p" This reverts commit ca8c0d5e811048ad67d0955642c5b486e9c0f3d2. By commiting ca8c0d5e8110 I was hoping that the existing option -d could just be extended to work with -p to implement a feature that was and I think is still needed, that is to show all descendant processes of a given process id or a set of process ids. After a complaint from -current which may represent a wider dissatisfaction with this change in the program's behavior, I think it will be better to revert ca8c0d5e8110 and reintroduce this feature using a separate option -D. --- bin/ps/ps.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/bin/ps/ps.c b/bin/ps/ps.c index e7781d1d9310..8554a2eaa0a2 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -502,7 +502,7 @@ main(int argc, char *argv[]) what = KERN_PROC_PGRP | showthreads; flag = *pgrplist.l.pids; nselectors = 0; - } else if (pidlist.count == 1 && !descendancy) { + } else if (pidlist.count == 1) { what = KERN_PROC_PID | showthreads; flag = *pidlist.l.pids; nselectors = 0; @@ -537,14 +537,6 @@ main(int argc, char *argv[]) if ((kp == NULL && errno != ESRCH) || (kp != NULL && nentries < 0)) xo_errx(1, "%s", kvm_geterr(kd)); nkept = 0; - if (descendancy) - for (elem = 0; elem < pidlist.count; elem++) - for (i = 0; i < nentries; i++) - if (kp[i].ki_ppid == pidlist.l.pids[elem]) { - if (pidlist.count >= pidlist.maxcount) - expand_list(&pidlist); - pidlist.l.pids[pidlist.count++] = kp[i].ki_pid; - } if (nentries > 0) { if ((kinfo = malloc(nentries * sizeof(*kinfo))) == NULL) xo_errx(1, "malloc failed");