diff --git a/src/lib/lwext4/block.cc b/src/lib/lwext4/block.cc index a4af16e..f76a124 100644 --- a/src/lib/lwext4/block.cc +++ b/src/lib/lwext4/block.cc @@ -15,7 +15,6 @@ #include #include #include -#include #include #include diff --git a/src/lib/lwext4/libc.cc b/src/lib/lwext4/libc.cc index c92647b..c0fa379 100644 --- a/src/lib/lwext4/libc.cc +++ b/src/lib/lwext4/libc.cc @@ -14,7 +14,8 @@ /* Genode includes */ #include #include -#include +#include +#include #include /* library includes */ @@ -57,18 +58,27 @@ int fflush(FILE *) int printf(char const *fmt, ...) { + static char buffer[Genode::Log_session::MAX_STRING_LEN]; + va_list list; va_start(list, fmt); - Genode::vprintf(fmt, list); + Genode::String_console sc(buffer, sizeof (buffer)); + sc.vprintf(fmt, list); va_end(list); + /* remove newline as Genode::log() will implicitly add one */ + size_t n = sc.len(); + if (n > 0 && buffer[n-1] == '\n') { n--; } + + Genode::log(Genode::Cstring(buffer, n)); + return 0; } int puts(const char *s) { - Genode::printf(s); + printf("%s\n", s); return 0; }