lwext4: remove depcreated APIs

Fixes #140.
This commit is contained in:
Josef Söntgen
2019-02-19 13:28:34 +01:00
committed by Norman Feske
parent b9480c0b22
commit 02d5c36cc0
2 changed files with 13 additions and 4 deletions

View File

@@ -15,7 +15,6 @@
#include <base/allocator.h>
#include <base/allocator_avl.h>
#include <base/log.h>
#include <base/printf.h>
#include <block_session/connection.h>
#include <util/string.h>

View File

@@ -14,7 +14,8 @@
/* Genode includes */
#include <base/allocator.h>
#include <base/log.h>
#include <base/printf.h>
#include <base/snprintf.h>
#include <log_session/log_session.h>
#include <util/string.h>
/* 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;
}