From f239a414c14de4929c6bb120e35d6937863288fc Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Sun, 4 Nov 2007 18:51:49 +0000 Subject: Also show warning message for -U and -p in message area; noted by Mark Lumsden --- usr.bin/top/top.c | 20 ++++++++++---------- 1 file 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; } -- cgit v1.2.3