summaryrefslogtreecommitdiffstats
path: root/common/console.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-10-14 08:56:22 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-11-11 12:20:21 +0100
commit8fe1e8fd41ba872760f3c9241167488e4a506950 (patch)
tree43426f41d1a82d00912d80289589997f23f4cb04 /common/console.c
parent84b222987eea1a57308732c47a3006fecd6c8219 (diff)
downloadbarebox-8fe1e8fd41ba872760f3c9241167488e4a506950.tar.gz
barebox-8fe1e8fd41ba872760f3c9241167488e4a506950.tar.xz
console: fix return values of puts functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/common/console.c b/common/console.c
index 06e9c29e8c..e82934b865 100644
--- a/common/console.c
+++ b/common/console.c
@@ -292,24 +292,30 @@ int fputc(int fd, char c)
}
EXPORT_SYMBOL(fputc);
-void console_puts(unsigned int ch, const char *str)
+int console_puts(unsigned int ch, const char *str)
{
const char *s = str;
+ int n = 0;
+
while (*s) {
- if (*s == '\n')
+ if (*s == '\n') {
console_putc(ch, '\r');
+ n++;
+ }
console_putc(ch, *s);
+ n++;
s++;
}
+ return n;
}
EXPORT_SYMBOL(console_puts);
int fputs(int fd, const char *s)
{
if (fd == 1)
- puts(s);
+ return puts(s);
else if (fd == 2)
- eputs(s);
+ return eputs(s);
else
return write(fd, s, strlen(s));
return 0;