Remove return value of Log_session::write

Fixes #3749
This commit is contained in:
Norman Feske
2020-05-05 13:51:05 +02:00
parent bbc21cf063
commit a9f0e47ea3
12 changed files with 22 additions and 39 deletions

View File

@@ -61,7 +61,7 @@ struct Dummy::Log_service
log("closing session with label ", _label);
}
size_t write(String const &string) override
void write(String const &string) override
{
/* strip known line delimiter from incoming message */
unsigned n = 0;
@@ -71,8 +71,6 @@ struct Dummy::Log_service
typedef Genode::String<100> Message;
Message const message("[", _label, "] ", Cstring(string.string(), n));
log(message);
return strlen(string.string());
}
};

View File

@@ -76,13 +76,13 @@ class Fs_log::Session_component : public Genode::Rpc_object<Genode::Log_session>
** Log session **
*****************/
Genode::size_t write(Log_session::String const &msg) override
void write(Log_session::String const &msg) override
{
using namespace Genode;
if (!msg.valid_string()) {
Genode::error("received corrupted string");
return 0;
return;
}
size_t msg_len = strlen(msg.string());
@@ -123,7 +123,6 @@ class Fs_log::Session_component : public Genode::Rpc_object<Genode::Log_session>
memcpy(buf, msg.string(), msg_len);
source.submit_packet(packet);
return msg_len;
}
};

View File

@@ -52,11 +52,11 @@ namespace Genode {
* The following function's code is a modified variant of the one in:
* 'base/src/core/include/log_session_component.h'
*/
size_t write(String const &string_buf) override
void write(String const &string_buf) override
{
if (!(string_buf.valid_string())) {
Genode::error("corrupted string");
return 0;
return;
}
char const *string = string_buf.string();
@@ -73,7 +73,7 @@ namespace Genode {
enum { ESC = 27 };
if ((string[0] == ESC) && (len == 5) && (string[4] == '\n')) {
_terminal.write(string, len - 1);
return len;
return;
}
_terminal.write(_label, strlen(_label));
@@ -85,8 +85,6 @@ namespace Genode {
/* carriage-return as expected by hardware terminals on newline */
_terminal.write("\r", 1);
return len;
}
};

View File

@@ -138,7 +138,7 @@ class Test::Log_session_component : public Rpc_object<Log_session>
_label(label), _handler(handler)
{ }
size_t write(String const &string) override
void write(String const &string) override
{
/* strip known line delimiter from incoming message */
unsigned n = 0;
@@ -153,8 +153,6 @@ class Test::Log_session_component : public Rpc_object<Log_session>
_handler.handle_log_message(message);
log(message, " (", result, ")");
return strlen(string.string());
}
};

View File

@@ -31,13 +31,11 @@ struct Test::Log_session_component : Session_object<Log_session>
template <typename... ARGS>
Log_session_component(ARGS &&... args) : Session_object(args...) { }
size_t write(String const &msg) override
void write(String const &msg) override
{
/* omit line break and zero termination supplied by 'msg' */
if (msg.size() > 1)
log("local LOG service: ", Cstring(msg.string(), msg.size() - 2));
return 0;
}
};