summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-02-21 01:22:48 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2009-03-19 12:21:24 +0100
commit8a2e721fc56e848f182dddb9e494ed284e382d09 (patch)
treeea532df269b3708aa9c8f584588f022cbd11a01c /common
parent0b5a776c1e9cc6dec8d5fa6d2f97eb8f19d3d325 (diff)
downloadbarebox-8a2e721fc56e848f182dddb9e494ed284e382d09.tar.gz
barebox-8a2e721fc56e848f182dddb9e494ed284e382d09.tar.xz
Flush consoles before exiting
We use FIFOs on some devices, so flush them before exiting so we do not get funny characters in the output. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/console.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index de487fc140..68ef80ea95 100644
--- a/common/console.c
+++ b/common/console.c
@@ -301,6 +301,17 @@ int fputs(int fd, const char *s)
}
EXPORT_SYMBOL(fputs);
+void console_flush(void)
+{
+ struct console_device *cdev;
+
+ for_each_console(cdev) {
+ if (cdev->flush)
+ cdev->flush(cdev);
+ }
+}
+EXPORT_SYMBOL(console_flush);
+
void fprintf (int file, const char *fmt, ...)
{
va_list args;