diff options
author | Tom Rini <trini@konsulko.com> | 2018-07-26 15:55:42 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-07-26 15:55:42 -0400 |
commit | a57d45db90c8de2959b4484cc8f6ba81219a2269 (patch) | |
tree | 0f4bb63c28f89aea45db67d82bf53de87d930e44 /common/console.c | |
parent | 2547e91dc15e5203e15d4ebde9172174743b14a7 (diff) | |
parent | 26026e695afa794ac018a09e79a48120d322b60d (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-net
Diffstat (limited to 'common/console.c')
-rw-r--r-- | common/console.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/common/console.c b/common/console.c index 2ba33dc5740..7aa58d0a636 100644 --- a/common/console.c +++ b/common/console.c @@ -196,20 +196,21 @@ static int console_tstc(int file) { int i, ret; struct stdio_dev *dev; + int prev; - disable_ctrlc(1); + prev = disable_ctrlc(1); for (i = 0; i < cd_count[file]; i++) { dev = console_devices[file][i]; if (dev->tstc != NULL) { ret = dev->tstc(dev); if (ret > 0) { tstcdev = dev; - disable_ctrlc(0); + disable_ctrlc(prev); return ret; } } } - disable_ctrlc(0); + disable_ctrlc(prev); return 0; } @@ -603,7 +604,6 @@ static int ctrlc_disabled = 0; /* see disable_ctrl() */ static int ctrlc_was_pressed = 0; int ctrlc(void) { -#ifndef CONFIG_SANDBOX if (!ctrlc_disabled && gd->have_console) { if (tstc()) { switch (getc()) { @@ -615,7 +615,6 @@ int ctrlc(void) } } } -#endif return 0; } |