Disable debug keys in ttycX

Function keys in any virtual console create some dump on main
console (first virtual, /dev/console); unless debug_fkeys=0 is set
in boot monitor, in which case no function keys generate dump.

With this patch, you can restrict the virtual console where dumps
are produced; with debug_fkeys=0, none generates dumps (unchanged);
with debug_fkeys=1 (most useful setting), only the first virtual
console, which is the one which gets the dumps, can generate output;
on second and further consoles (/dev/ttyc?), the function keys are
passed to applications.
This commit is contained in:
Antoine Leca 2011-08-07 12:52:00 +02:00 committed by Lionel Sambuc
parent 2e7f322973
commit fd76ae7d5c

View File

@ -150,7 +150,7 @@ static struct kbd_outack
static int kbd_watchdog_set= 0;
static int kbd_alive= 1;
static long sticky_alt_mode = 0;
static long debug_fkeys = 1;
static long debug_fkeys = NR_CONS;
static timer_t tmr_kbd_wd;
static void handle_req(struct kbd *kbdp, message *m);
@ -594,7 +594,7 @@ int try;
}
/* Function keys are being used for debug dumps (if enabled). */
if (debug_fkeys && func_key(scode)) continue;
if (debug_fkeys>ccurrent && func_key(scode)) continue;
/* Perform make/break processing. */
@ -613,7 +613,7 @@ int try;
(void) in_process(tp, buf, 3, scode);
} else
if ((F1 <= ch && ch <= F12) || (SF1 <= ch && ch <= SF12) ||
(CF1 <= ch && ch <= CF12 && !debug_fkeys)) {
(CF1 <= ch && ch <= CF12 && (debug_fkeys<=ccurrent))) {
/* An escape sequence generated by function keys. */
if (F1 <= ch && ch <= F12) {
ch -= F1;