Commit bf27a225 authored by Math Ieu's avatar Math Ieu Committed by Piotr Pawel Stefaniak
Browse files

ps: fix `ps -aa`

Passing the -a flag multiple times made ps show no processes.

Differential Revision:	https://reviews.freebsd.org/D27215
parent 7c2f227a
......@@ -253,11 +253,9 @@ main(int argc, char *argv[])
* added for compatibility with SUSv3, but for
* now it will not be described in the man page.
*/
nselectors++;
all = xkeep = 1;
break;
case 'a':
nselectors++;
all = 1;
break;
case 'C':
......@@ -473,7 +471,7 @@ main(int argc, char *argv[])
if (!_fmt)
parsefmt(dfmt, 0);
if (nselectors == 0) {
if (!all && nselectors == 0) {
uidlist.l.ptr = malloc(sizeof(uid_t));
if (uidlist.l.ptr == NULL)
xo_errx(1, "malloc failed");
......@@ -526,9 +524,6 @@ main(int argc, char *argv[])
what = KERN_PROC_UID | showthreads;
flag = *uidlist.l.uids;
nselectors = 0;
} else if (all) {
/* No need for this routine to select processes. */
nselectors = 0;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment