mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-23 06:41:36 +02:00
console: Remember if ctrlc is disabled in console_tstc()
We don't necessarily want to re-enable ctrl-c if it was already disabled when calling tstc(). Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
08fcdd332f
commit
b2f58d8ee0
@ -196,20 +196,21 @@ static int console_tstc(int file)
|
|||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
struct stdio_dev *dev;
|
struct stdio_dev *dev;
|
||||||
|
int prev;
|
||||||
|
|
||||||
disable_ctrlc(1);
|
prev = disable_ctrlc(1);
|
||||||
for (i = 0; i < cd_count[file]; i++) {
|
for (i = 0; i < cd_count[file]; i++) {
|
||||||
dev = console_devices[file][i];
|
dev = console_devices[file][i];
|
||||||
if (dev->tstc != NULL) {
|
if (dev->tstc != NULL) {
|
||||||
ret = dev->tstc(dev);
|
ret = dev->tstc(dev);
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
tstcdev = dev;
|
tstcdev = dev;
|
||||||
disable_ctrlc(0);
|
disable_ctrlc(prev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
disable_ctrlc(0);
|
disable_ctrlc(prev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user