diff options
author | lum <lum@cvs.openbsd.org> | 2012-06-08 13:41:17 +0000 |
---|---|---|
committer | lum <lum@cvs.openbsd.org> | 2012-06-08 13:41:17 +0000 |
commit | e946225547cc058b112b16671384cec90befc2af (patch) | |
tree | caac4370cd5e43523e6675c8b409d19c73171b37 /usr.bin | |
parent | 012904c1747e594ef85b3e47ca7cc69cf86f6d57 (diff) |
Add checks for command line input (or the TOP environment var)
ommitted from 1.78. Now a $ top -U -username -U username command will
behave the same as interactive mode. ok brynet@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/top/top.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 7a79fe72f54..377c9834638 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -1,4 +1,4 @@ -/* $OpenBSD: top.c,v 1.78 2012/06/05 18:52:53 brynet Exp $ */ +/* $OpenBSD: top.c,v 1.79 2012/06/08 13:41:16 lum Exp $ */ /* * Top users/processes display for Unix @@ -153,9 +153,13 @@ parseargs(int ac, char **av) if ((ps.huid = userid(optarg+1)) == (uid_t)-1) new_message(MT_delayed, "%s: unknown user", optarg); + else + ps.uid = (uid_t)-1; } else if ((ps.uid = userid(optarg)) == (uid_t)-1) new_message(MT_delayed, "%s: unknown user", optarg); + else + ps.huid = (uid_t)-1; break; case 'p': { /* display only process id */ |