summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2007-11-04 18:51:48 +0000
committerotto <otto@openbsd.org>2007-11-04 18:51:48 +0000
commit108e458bb7c56c16b087121a8fdaadd1f50bf6eb (patch)
tree28c563adf0c373984c654332be6aab81534b3a6d
parentUpdate from master repo: (diff)
downloadwireguard-openbsd-108e458bb7c56c16b087121a8fdaadd1f50bf6eb.tar.xz
wireguard-openbsd-108e458bb7c56c16b087121a8fdaadd1f50bf6eb.zip
Also show warning message for -U and -p in message area; noted by Mark
Lumsden
-rw-r--r--usr.bin/top/top.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index 32f4e4634fe..b096b798783 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: top.c,v 1.60 2007/11/04 18:45:48 otto Exp $ */
+/* $OpenBSD: top.c,v 1.61 2007/11/04 18:51:48 otto Exp $ */
/*
* Top users/processes display for Unix
@@ -145,22 +145,22 @@ parseargs(int ac, char **av)
break;
case 'U': /* display only username's processes */
- if ((ps.uid = userid(optarg)) == (uid_t)-1) {
- fprintf(stderr, "%s: unknown user\n", optarg);
- exit(1);
- }
+ if ((ps.uid = userid(optarg)) == (uid_t)-1)
+ new_message(MT_delayed, "%s: unknown user",
+ optarg);
break;
case 'p': { /* display only process id */
const char *errstr;
i = strtonum(optarg, 0, INT_MAX, &errstr);
- if (errstr != NULL || !find_pid(i)) {
- fprintf(stderr, "%s: unknown pid\n", optarg);
- exit(1);
+ if (errstr != NULL || !find_pid(i))
+ new_message(MT_delayed, "%s: unknown pid",
+ optarg);
+ else {
+ ps.pid = (pid_t)i;
+ ps.system = Yes;
}
- ps.pid = (pid_t)i;
- ps.system = Yes;
break;
}