diff options
author | 2012-06-08 13:41:16 +0000 | |
---|---|---|
committer | 2012-06-08 13:41:16 +0000 | |
commit | b6073ef1020f16e6d84113ec136f099caefb07e7 (patch) | |
tree | d4b8893df81323e1eb6e4c732f24c2e4b3bca073 | |
parent | add missing header needed by time() (diff) | |
download | wireguard-openbsd-b6073ef1020f16e6d84113ec136f099caefb07e7.tar.xz wireguard-openbsd-b6073ef1020f16e6d84113ec136f099caefb07e7.zip |
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@
-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 */ |