This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [Patch] ps command returns 1 if PID not found
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Thu, 17 Dec 2009 22:32:32 -0500
- Subject: Re: [Patch] ps command returns 1 if PID not found
- References: <b4864b490912171610k4c462d43p1298b0b1116af018@mail.gmail.com>
- Reply-to: cygwin-patches at cygwin dot com
On Fri, Dec 18, 2009 at 11:10:40AM +1100, Ryan Dortmans wrote:
>>Sorry but returning 1 doesn't make sense and it isn't the way that linux
>>works. It actually returns 0.
>
>dortmans> /bin/ps -p 4549 ; echo "Return val: $?"
> PID TTY TIME CMD
> 4549 ? 00:00:00 sshd
>Return val: 0
>dortmans> /bin/ps -p 1111 ; echo "Return val: $?"
> PID TTY TIME CMD
>Return val: 1
>
>dortmans> /bin/ps --version
>procps version 3.2.3
>
>I get these results in Solaris Unix and Red Hat Linux. The above
>commands were executed on a Red Hat Linux system.
Yes, I'm officially stupid. Not only did I misread your subject, I
misinterpreted the sense of the patch. Sorry.
Nevertheless, I think that my patch does the right thing so I'll check
that in since it affects fewer lines of code.
Thanks for the patch and apologies for the inexplicable
misunderstanding.
cgf