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: Ryan Dortmans <ryandort dot cygwin at gmail dot com>
- To: cygwin-patches at cygwin dot com
- Date: Fri, 18 Dec 2009 11:10:40 +1100
- Subject: Re: [Patch] ps command returns 1 if PID not found
>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.
Cheers,
Ryan Dortmans