[PATCH] console_countdown: use CTL_CH macro for control characters

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

 



This introduces no functional change, but makes code more readable as
it's directly evident that the 3 here means ctrl+c.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 common/console_countdown.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/console_countdown.c b/common/console_countdown.c
index e41641aca23e..832505c1d755 100644
--- a/common/console_countdown.c
+++ b/common/console_countdown.c
@@ -10,6 +10,7 @@
 #include <errno.h>
 #include <console_countdown.h>
 #include <stdio.h>
+#include <readkey.h>
 
 static bool console_countdown_timeout_abort;
 
@@ -57,7 +58,7 @@ int console_countdown(int timeout_s, unsigned flags, const char *keys,
 					goto out;
 				if (flags & CONSOLE_COUNTDOWN_RETURN && (key == '\n' || key == '\r'))
 					goto out;
-				if (flags & CONSOLE_COUNTDOWN_CTRLC && key == 3)
+				if (flags & CONSOLE_COUNTDOWN_CTRLC && key == CTL_CH('c'))
 					goto out;
 			}
 			key = 0;
-- 
2.39.5





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux