make specifying just proc 0 work
authorJay Lepreau <lepreau@ucbvax.Berkeley.EDU>
Fri, 10 Jan 1986 19:50:27 +0000 (11:50 -0800)
committerJay Lepreau <lepreau@ucbvax.Berkeley.EDU>
Fri, 10 Jan 1986 19:50:27 +0000 (11:50 -0800)
SCCS-vsn: bin/ps/ps.c 5.5

usr/src/bin/ps/ps.c

index 832f79e..2389e77 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)ps.c       5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)ps.c       5.5 (Berkeley) %G%";
 #endif not lint
 
 #include <stdio.h>
 #endif not lint
 
 #include <stdio.h>
@@ -156,7 +156,7 @@ char        *psdb   = "/etc/psdatabase";
 char   *psdb   = PSFILE;
 #endif
 
 char   *psdb   = PSFILE;
 #endif
 
-int    chkpid;
+int    chkpid = -1;
 int    aflg, cflg, eflg, gflg, kflg, lflg, nflg, sflg,
        uflg, vflg, xflg, Uflg;
 int    nchans;                         /* total # of wait channels */
 int    aflg, cflg, eflg, gflg, kflg, lflg, nflg, sflg,
        uflg, vflg, xflg, Uflg;
 int    nchans;                         /* total # of wait channels */
@@ -363,7 +363,7 @@ main(argc, argv)
                                continue;
                        if (uid != mproc->p_uid && aflg==0)
                                continue;
                                continue;
                        if (uid != mproc->p_uid && aflg==0)
                                continue;
-                       if (chkpid != 0 && chkpid != mproc->p_pid)
+                       if (chkpid != -1 && chkpid != mproc->p_pid)
                                continue;
                        if (vflg && gflg == 0 && xflg == 0) {
                                if (mproc->p_stat == SZOMB ||
                                continue;
                        if (vflg && gflg == 0 && xflg == 0) {
                                if (mproc->p_stat == SZOMB ||