[PATCH 2/2] Add disabled text to indicate inactive commands in sysrq help menu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds disabled text after disabled commands in sysrq help.

before:
sak : k

after:
sak : k (disabled)

Signed-off-by: Andras Sebok <sebokandris2009@xxxxxxxxx>
---
 drivers/tty/sysrq.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 831cdadf366f..1af78f76232e 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -617,6 +617,9 @@ void __handle_sysrq(int key, bool check_mask)
 				if (j != i)
 					continue;
 				pr_cont("%s ", sysrq_key_table[i]->help_msg);
+				if (!check_mask || (check_mask &&
+					!sysrq_on_mask(sysrq_key_table[i]->enable_mask)))
+					pr_cont("(disabled)");
 				pr_cont("\n");
 			}
 		}
-- 
2.41.0




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux