From owner-cvs-src@FreeBSD.ORG Wed Mar 17 16:37:01 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B8DE16A4CE; Wed, 17 Mar 2004 16:37:01 -0800 (PST) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id B4A1C43D2F; Wed, 17 Mar 2004 16:37:00 -0800 (PST) (envelope-from gad@FreeBSD.org) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2I0axoP003316; Wed, 17 Mar 2004 19:37:00 -0500 Mime-Version: 1.0 X-Sender: gad@gilead.netel.rpi.edu (Unverified) Message-Id: In-Reply-To: <20040317145908.P3595@root.org> References: <20040317224702.A8A0416A52E@hub.freebsd.org> <20040317145908.P3595@root.org> Date: Wed, 17 Mar 2004 19:36:58 -0500 To: Nate Lawson From: Garance A Drosehn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/ps ps.1 ps.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2004 00:37:01 -0000 At 2:59 PM -0800 3/17/04, Nate Lawson wrote: >On Wed, 17 Mar 2004, Garance A Drosehn wrote: >> Modified files: >> bin/ps ps.1 ps.c >> Log: > > Improvements to 'ps -p '. If is a process id that does > > not exist, then just print the header (if any) and exit, thus > > matching the behavior on -stable and other OS's. >If not found, shouldn't it print no header, an error message to >stderr and return non-zero? It isn't clear from SUSv3 if it should do that. And, as mentioned, the behavior in -stable is the same as the behavior on other OS's, so I felt that it was reasonable to keep that behavior in -current. Further, 'ps -U someuser' does not give an error message when there are no processes matching that user. 'ps' only does that if there is no userid named 'someuser'. It's the same for 'ps -t /dev/ttyx'. Also consider the (now supported) case of: ps -p 1,12790 if process #1 does exist, and process #12790 does not exist. Do you really want 'ps' to abort in that case, with a message to stderr? I do not feel that is desirable. However, in some further checking on other OS's, I do see that 'ps' does seem to return non-zero if there are no processes which match the given process-list or user-list. And we also seem to do that for '-u someuser'. Given that I basically copied the userlist code to create the support for process-lists, I will have to check why 'ps' does a zero-return in some cases where no processes are matched. I didn't intend that. I'll try to get that fixed tonight. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA