+2009-12-17 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * ps.cc (main): Return 0 if pid found.
+
2009-12-16 Corinna Vinschen <corinna@vinschen.de>
* regtool.cc: Throughout, convert all registry calls to wide char
for that value. Note that PATH_MAX is only 4K. */
#define NT_MAX_PATH 32768
-static const char version[] = "$Revision$";
+static const char version[] = "$Revision: 1.11 $";
static char *prog_name;
static struct option longopts[] =
{
external_pinfo *p;
int aflag, lflag, fflag, sflag, uid, proc_id;
+ bool found_proc_id = true;
cygwin_getinfo_types query = CW_GETPINFO;
const char *dtitle = " PID TTY STIME COMMAND\n";
const char *dfmt = "%7d%4s%10s %s\n";
case 'p':
proc_id = atoi (optarg);
aflag = 1;
+ found_proc_id = false;
break;
case 's':
sflag = 1;
{
if ((proc_id > 0) && (p->pid != proc_id))
continue;
+ else
+ found_proc_id = true;
if (aflag)
/* nothing to do */;
}
(void) cygwin_internal (CW_UNLOCK_PINFO);
- return 0;
+ return found_proc_id ? 0 : 1;
}
-