summaryrefslogtreecommitdiffstats
path: root/common/console.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-10-07 08:00:13 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-10-07 08:00:13 +0200
commit9aa6dd027012892d14aa53f9c3d6965c37afc001 (patch)
treeb97a8cb9ee8bf1c154ca52c010c9808d02b4fd85 /common/console.c
parent408f054247fa7250546bc041b1deb306d0b9fa98 (diff)
parent666f12e0c19a19f4431e05f6e5b37e657a62038f (diff)
downloadbarebox-9aa6dd027012892d14aa53f9c3d6965c37afc001.tar.gz
Merge branch 'for-next/login'
Conflicts: include/console.h
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index 4ca5f18..56bc864 100644
--- a/common/console.c
+++ b/common/console.c
@@ -238,6 +238,9 @@ int getc(void)
unsigned char ch;
uint64_t start;
+ if (unlikely(!console_is_input_allow()))
+ return -EPERM;
+
/*
* For 100us we read the characters from the serial driver
* into a kfifo. This helps us not to lose characters
@@ -272,6 +275,9 @@ EXPORT_SYMBOL(fgetc);
int tstc(void)
{
+ if (unlikely(!console_is_input_allow()))
+ return 0;
+
return kfifo_len(console_input_fifo) || tstc_raw();
}
EXPORT_SYMBOL(tstc);