summaryrefslogtreecommitdiffstats
path: root/pg_top.c
diff options
context:
space:
mode:
authorMark Wong <markwkm@gmail.com>2008-08-28 18:05:50 -0700
committerMark Wong <markwkm@gmail.com>2008-08-28 18:05:50 -0700
commit5c1459f29690c1fc4e5a061400725bed1776b4c2 (patch)
tree629516dbed68d6b4da00945f5d157ecc54324708 /pg_top.c
parent43c155bc9bf3f9c16f23369c6d7bcfacd38528fe (diff)
Disallow 'kill' and 'renice' when connected to a remote database system.
Diffstat (limited to 'pg_top.c')
-rw-r--r--pg_top.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/pg_top.c b/pg_top.c
index aa514ea..5e7d7d8 100644
--- a/pg_top.c
+++ b/pg_top.c
@@ -1127,6 +1127,13 @@ Usage: %s [-ITWbcinqru] [-x x] [-s x] [-o field] [-z username]\n\
#ifdef ENABLE_KILL
case CMD_kill: /* kill program */
+ if (mode_remote == 1)
+ {
+ new_message(MT_standout, "Cannot kill when accessing a remote database.");
+ putchar('\r');
+ no_command = Yes;
+ break;
+ }
new_message(0, "kill ");
if (readline(tempbuf2, sizeof(tempbuf2), No) > 0)
{
@@ -1144,6 +1151,13 @@ Usage: %s [-ITWbcinqru] [-x x] [-s x] [-o field] [-z username]\n\
break;
case CMD_renice: /* renice program */
+ if (mode_remote == 1)
+ {
+ new_message(MT_standout, "Cannot renice when accessing a remote database.");
+ putchar('\r');
+ no_command = Yes;
+ break;
+ }
new_message(0, "renice ");
if (readline(tempbuf2, sizeof(tempbuf2), No) > 0)
{