summaryrefslogtreecommitdiff
path: root/usr.bin/top/top.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-02-04 19:17:15 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-02-04 19:17:15 +0000
commitd86323c9a2ac58f90473bfa7c1143c1bd18df832 (patch)
tree58727f19280c8d9fc07f63f79324ec991debf26f /usr.bin/top/top.c
parent3d970d8fa2cd0f98c5981105afbdbfe9e32ec31a (diff)
Introducing the '+' interactive command to reset all filters.
From Mark Lumsden. ok millert@ deraadt@ simon@
Diffstat (limited to 'usr.bin/top/top.c')
-rw-r--r--usr.bin/top/top.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index a566cfa7ea6..c079ea772f5 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: top.c,v 1.46 2007/02/04 15:01:11 otto Exp $ */
+/* $OpenBSD: top.c,v 1.47 2007/02/04 19:17:14 otto Exp $ */
/*
* Top users/processes display for Unix
@@ -129,6 +129,7 @@ char topn_specified = No;
#define CMD_command 18
#define CMD_threads 19
#define CMD_grep 20
+#define CMD_add 21
static void
usage(void)
@@ -528,7 +529,7 @@ rundisplay(void)
int change, i;
struct pollfd pfd[1];
uid_t uid;
- static char command_chars[] = "\f qh?en#sdkriIuSopCTg";
+ static char command_chars[] = "\f qh?en#sdkriIuSopCTg+";
/*
* assume valid command unless told
@@ -890,6 +891,13 @@ rundisplay(void)
clear_message();
break;
+ case CMD_add:
+ ps.uid = (uid_t)-1; /* uid */
+ ps.pid = (pid_t)-1; /* pid */
+ ps.system = old_system;
+ ps.command = NULL; /* grep */
+ break;
+
default:
new_message(MT_standout, " BAD CASE IN SWITCH!");
if (putchar('\r') == EOF)