summaryrefslogtreecommitdiffstats
path: root/common/console_simple.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_simple.c
parent408f054247fa7250546bc041b1deb306d0b9fa98 (diff)
parent666f12e0c19a19f4431e05f6e5b37e657a62038f (diff)
downloadbarebox-9aa6dd027012892d14aa53f9c3d6965c37afc001.tar.gz
barebox-9aa6dd027012892d14aa53f9c3d6965c37afc001.tar.xz
Merge branch 'for-next/login'
Conflicts: include/console.h
Diffstat (limited to 'common/console_simple.c')
-rw-r--r--common/console_simple.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/console_simple.c b/common/console_simple.c
index 5ab937fdb7..6cb72bb46a 100644
--- a/common/console_simple.c
+++ b/common/console_simple.c
@@ -3,6 +3,7 @@
#include <fs.h>
#include <errno.h>
#include <debug_ll.h>
+#include <console.h>
LIST_HEAD(console_list);
EXPORT_SYMBOL(console_list);
@@ -40,6 +41,9 @@ EXPORT_SYMBOL(console_putc);
int tstc(void)
{
+ if (unlikely(!console_is_input_allow()))
+ return 0;
+
if (!console)
return 0;
@@ -49,6 +53,9 @@ EXPORT_SYMBOL(tstc);
int getc(void)
{
+ if (unlikely(!console_is_input_allow()))
+ return -EPERM;
+
if (!console)
return -EINVAL;
return console->getc(console);