mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 02:01:38 +00:00
core: add session args filter to Core_child
Add the filter_session_args() method to Core_child to prefix the labels of its children. Fixes #789.
This commit is contained in:
parent
4ba17f7ebd
commit
136af3764d
@ -138,6 +138,25 @@ class Core_child : public Child_policy
|
||||
** Child-policy interface **
|
||||
****************************/
|
||||
|
||||
void filter_session_args(const char *, char *args,
|
||||
Genode::size_t args_len)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
char label_buf[Parent::Session_args::MAX_SIZE];
|
||||
Arg_string::find_arg(args, "label").string(label_buf, sizeof(label_buf), "");
|
||||
|
||||
char value_buf[Parent::Session_args::MAX_SIZE];
|
||||
Genode::snprintf(value_buf, sizeof(value_buf),
|
||||
"\"%s%s%s\"",
|
||||
"init",
|
||||
Genode::strcmp(label_buf, "") == 0 ? "" : " -> ",
|
||||
label_buf);
|
||||
|
||||
Arg_string::set_arg(args, args_len, "label", value_buf);
|
||||
}
|
||||
|
||||
|
||||
const char *name() const { return "init"; }
|
||||
|
||||
Service *resolve_session_request(const char *service, const char *)
|
||||
|
Loading…
x
Reference in New Issue
Block a user