From 7ce21703892fac7084d417d296fc2723a85e7c10 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Wed, 10 Mar 2021 09:47:57 +0100 Subject: console: unconditionally run resched() in ctrlc() ctrlc is allowed only after init and reboot mode scripts have run, so these scripts run uninterruptible. A side effect of this is that all calls to ctrlc() will immediately return with false without running the pollers. While init scripts shouldn't run too long, it's still surprising behavior. Thus call resched() first thing in ctrlc(). Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- common/console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/console.c b/common/console.c index a436c37aa3..8a0af75a1f 100644 --- a/common/console.c +++ b/common/console.c @@ -579,14 +579,14 @@ int ctrlc(void) { int ret = 0; + resched(); + if (!ctrlc_allowed) return 0; if (ctrlc_abort) return 1; - resched(); - #ifdef ARCH_HAS_CTRLC ret = arch_ctrlc(); #else -- cgit v1.2.3