[PATCH] Add -p option to ps command

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Add -p option to ps command

Jerry D. Hedden
Attached is a patch to add a -p option to the ps command to show
information for only a single PID:  ps -p PID
This option is available on other implementations of ps (e.g., Solaris).

ps.cc.patch (3K) Download Attachment
cygwin-ug-net.sgml.patch (1K) Download Attachment
cygwin-ug-net.texi.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add -p option to ps command

Corinna Vinschen-2
On Feb 14 07:12, Jerry D. Hedden wrote:
> Attached is a patch to add a -p option to the ps command to show
> information for only a single PID:  ps -p PID
> This option is available on other implementations of ps (e.g., Solaris).

Thanks for the patch.  It's barely short enough so that we decided to
put it in despite the fact that you have no copyright assignment
in place.  Please read http://cygwin.com/contrib.html for further
information about how to contribute.  Note especially the fact that
we need your copyright assignment for any substantial patch.

I applied your patch with some minor changes.  I fixed the wrongly set
curly braces at one point, I added the descriptive text to utils.sgml
(cygwin-ug-net.sgml is only a generated file) and, most important, I
added a ChangeLog entry.


Thanks,
Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat
Reply | Threaded
Open this post in threaded view
|

RE: [PATCH] Add -p option to ps command

Jerry D. Hedden
In reply to this post by Jerry D. Hedden
> On Feb 14 07:12, Jerry D. Hedden wrote:
> > Attached is a patch to add a -p option to the ps command to show
> > information for only a single PID:  ps -p PID

> Corrina Vinschen replied:
> Thanks for the patch.  It's barely short enough so that we decided to
> put it in despite the fact that you have no copyright assignment
> in place.

I will send one in today.

> I applied your patch with some minor changes.

Thanks.  I realized one minor oversight.  Using -p should imply -a so
that even if the PID is not owned by the current user, it will still
get listed.  I've attached a patch for this (just a one line addition)
that builds on top of the previous patch (i.e., apply it against
version 1.20 of ps.cc).  Thanks again.

ps.cc.patch (360 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add -p option to ps command

Corinna Vinschen-2
On Feb 16 07:58, Jerry D. Hedden wrote:
> Thanks.  I realized one minor oversight.  Using -p should imply -a so
> that even if the PID is not owned by the current user, it will still
> get listed.  I've attached a patch for this (just a one line addition)
> that builds on top of the previous patch (i.e., apply it against
> version 1.20 of ps.cc).  Thanks again.

> Index: src/winsup/utils/ps.cc
> ===================================================================
> --- ps.cc  1.20
> +++ ps.cc
> @@ -286,6 +286,7 @@
>   break;
>        case 'p':
>   proc_id = atoi (optarg);
> + aflag = 1;
>   break;
>        case 's':
>   sflag = 1;

What about the ChangeLog entry?  http://cygwin.com/contrib.html


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat
Reply | Threaded
Open this post in threaded view
|

RE: [PATCH] Add -p option to ps command

Jerry D. Hedden
In reply to this post by Jerry D. Hedden
> -------- Original Message --------
> Subject: Re: [PATCH] Add -p option to ps command
> From: Corinna Vinschen <[hidden email]>
> Date: Thu, February 16, 2006 10:09 am
> To: [hidden email]
>
> On Feb 16 07:58, Jerry D. Hedden wrote:
> > Thanks.  I realized one minor oversight.  Using -p should imply -a so
> > that even if the PID is not owned by the current user, it will still
> > get listed.  I've attached a patch for this (just a one line addition)
> > that builds on top of the previous patch (i.e., apply it against
> > version 1.20 of ps.cc).  Thanks again.
>
> > Index: src/winsup/utils/ps.cc
> > ===================================================================
> > --- ps.cc  1.20
> > +++ ps.cc
> > @@ -286,6 +286,7 @@
> >   break;
> >        case 'p':
> >   proc_id = atoi (optarg);
> > + aflag = 1;
> >   break;
> >        case 's':
> >   sflag = 1;
>
> What about the ChangeLog entry?  http://cygwin.com/contrib.html

I'll get this right one of these days.  Thanks for your patience.

Changelog entry:

2006-02-16  Jerry D. Hedden  <[hidden email]>

        * ps.cc (main): -p implies -a



Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add -p option to ps command

Corinna Vinschen-2
On Feb 16 10:46, Jerry D. Hedden wrote:
> > -------- Original Message --------
> > Subject: Re: [PATCH] Add -p option to ps command
> > From: Corinna Vinschen <[hidden email])


Would you please don't copy raw email addresses in your replies?

http://cygwin.com/acronyms/#PCYMTNQREAIYR


> 2006-02-16  Jerry D. Hedden  <[hidden email]>
>
> * ps.cc (main): -p implies -a

I've applied the patch, but your ChangeLog entry is a bit short.
I've changed it to "Set aflag if -p option is given."


Thanks,
Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat
Reply | Threaded
Open this post in threaded view
|

raw email addresses and ChangeLog entries?

Brian Ford
On Fri, 17 Feb 2006, Corinna Vinschen wrote:
> On Feb 16 10:46, Jerry D. Hedden wrote:
>
> Would you please don't copy raw email addresses in your replies?
> http://cygwin.com/acronyms/#PCYMTNQREAIYR
>
> > 2006-02-16  Jerry D. Hedden  <jerry at hedden dot us>

I've always been confused about the above dichotomy.  Is it ok to obfuscate
ChangeLog email addresses?  Otherwise, what's the point of PCYMTNQREAIYR
requests in cygwin-patches?

Sorry for being slightly OT.

--
Brian Ford
Lead Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained pilot...
Reply | Threaded
Open this post in threaded view
|

Re: raw email addresses and ChangeLog entries?

Corinna Vinschen-2
On Feb 17 09:52, Brian Ford wrote:

> On Fri, 17 Feb 2006, Corinna Vinschen wrote:
> > On Feb 16 10:46, Jerry D. Hedden wrote:
> >
> > Would you please don't copy raw email addresses in your replies?
> > http://cygwin.com/acronyms/#PCYMTNQREAIYR
> >
> > > 2006-02-16  Jerry D. Hedden  <jerry at hedden dot us>
>
> I've always been confused about the above dichotomy.  Is it ok to obfuscate
> ChangeLog email addresses?  Otherwise, what's the point of PCYMTNQREAIYR
> requests in cygwin-patches?

Dunno if I'm speaking for Chris here, too, but I usually send patches to
other lists without the date/name/email header, for the simple reason
that the date will change anyway to the date of checkin.  The name and
email address is given in the mail header anyway, so why bother?

As for quoting Jerry's email address again, I'm sorry that I didn't
notice that, but I was actually talking about quoting *my* email address
in the reply.  Just because this very email address is basically
/dev/null doesn't mean that we shouldn't care, IMHO.


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat
Reply | Threaded
Open this post in threaded view
|

Re: raw email addresses and ChangeLog entries?

Brian Ford
On Fri, 17 Feb 2006, Corinna Vinschen wrote:

> On Feb 17 09:52, Brian Ford wrote:
> > On Fri, 17 Feb 2006, Corinna Vinschen wrote:
> > > On Feb 16 10:46, Jerry D. Hedden wrote:
> > >
> > > Would you please don't copy raw email addresses in your replies?
> > > http://cygwin.com/acronyms/#PCYMTNQREAIYR
> > >
> > > > 2006-02-16  Jerry D. Hedden  <jerry at hedden dot us>
> >
> > I've always been confused about the above dichotomy.  Is it ok to obfuscate
> > ChangeLog email addresses?  Otherwise, what's the point of PCYMTNQREAIYR
> > requests in cygwin-patches?
>
> Dunno if I'm speaking for Chris here, too, but I usually send patches to
> other lists without the date/name/email header, for the simple reason
> that the date will change anyway to the date of checkin.  The name and
> email address is given in the mail header anyway, so why bother?

Sounds good.  I'm all for it if cgf agrees.

> As for quoting Jerry's email address again, I'm sorry that I didn't
> notice that, but I was actually talking about quoting *my* email address
> in the reply.  Just because this very email address is basically
> /dev/null doesn't mean that we shouldn't care, IMHO.

I understood that was your intent, and I wasn't objecting to you quoting
his email per se.  I was just questioning the practice of requiring them
on ChangeLog entries.

Thanks.

--
Brian Ford
Lead Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained pilot...
Reply | Threaded
Open this post in threaded view
|

Re: raw email addresses and ChangeLog entries?

Christopher Faylor-2
On Fri, Feb 17, 2006 at 03:24:41PM -0600, Brian Ford wrote:

>On Fri, 17 Feb 2006, Corinna Vinschen wrote:
>>On Feb 17 09:52, Brian Ford wrote:
>>>On Fri, 17 Feb 2006, Corinna Vinschen wrote:
>>>>On Feb 16 10:46, Jerry D. Hedden wrote:
>>>>
>>>>Would you please don't copy raw email addresses in your replies?
>>>>http://cygwin.com/acronyms/#PCYMTNQREAIYR
>>>>
>>>>>2006-02-16  Jerry D. Hedden  <jerry at hedden dot us>
>>>
>>>I've always been confused about the above dichotomy.  Is it ok to
>>>obfuscate ChangeLog email addresses?  Otherwise, what's the point of
>>>PCYMTNQREAIYR requests in cygwin-patches?
>
>>Dunno if I'm speaking for Chris here, too, but I usually send patches
>>to other lists without the date/name/email header, for the simple
>>reason that the date will change anyway to the date of checkin.  The
>>name and email address is given in the mail header anyway, so why
>>bother?
>
>Sounds good.  I'm all for it if cgf agrees.

Sorry, but I don't.  I've even mentioned what I prefer recently, i.e.,
in theory a ChangeLog is supposed to be a cut/paste with no
interpretation.  If I get a patch today, I should be able to just cut
and paste it today without any editing.

AFAIK, ChangeLogs have *always* been an exception to the "don't post raw
email addresses" rule.  Look at the gdb or gcc patches mailing lists.

The "don't use raw email addresses" rule that we try to enforce in the
Cygwin lists is basically a "don't do it because it is stupid and it
causes harm" rule.  There is typically no reason to put a raw email
address in the body of a non-patch message.  There *is* a reason to use
an email address when the email address is supposed to eventually be
recorded in a ChangeLog.

However, this isn't really worth a lot of debate (not that that has ever
stopped anyone in these lists).  It isn't the end of the world if
someone doesn't send their email address but my preference is to get a
complete ChangeLog and that seems to be what most other lists prefer as
well.

cgf
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Add -p option to ps command

Corinna Vinschen-2
In reply to this post by Jerry D. Hedden
Hi Jerry,

On Feb 16 07:58, Jerry D. Hedden wrote:

> > On Feb 14 07:12, Jerry D. Hedden wrote:
> > > Attached is a patch to add a -p option to the ps command to show
> > > information for only a single PID:  ps -p PID
>
> > Corrina Vinschen replied:
> > Thanks for the patch.  It's barely short enough so that we decided to
> > put it in despite the fact that you have no copyright assignment
> > in place.
>
> I will send one in today.

your copyright assignment arrived and is signed.  So, no worries
about that anymore for further patches :-)


Thanks,
Corinna


--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat