summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2021-03-10 09:47:57 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-03-17 11:55:30 +0100
commit7ce21703892fac7084d417d296fc2723a85e7c10 (patch)
treee5ddea094f1b0547775edc0fb06677b5259dace3 /common
parent5f129c98629190827dcd387ac79e0076bbc0eb25 (diff)
downloadbarebox-7ce21703892fac7084d417d296fc2723a85e7c10.tar.gz
barebox-7ce21703892fac7084d417d296fc2723a85e7c10.tar.xz
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 <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/console.c4
1 files 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