mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-22 08:50:09 +00:00
gems: remove the use of deprecated APIs
This patch also updates os/slave.h because the app/launcher cannot be reasonably updated without it. Issue #1987 Issue #3125
This commit is contained in:
@ -237,29 +237,25 @@ namespace Terminal {
|
||||
|
||||
Session_component *_create_session(const char *args)
|
||||
{
|
||||
Genode::size_t io_buffer_size = 4096;
|
||||
using namespace Genode;
|
||||
|
||||
try {
|
||||
Genode::Session_label label = Genode::label_from_args(args);
|
||||
Genode::Session_policy policy(label, _config);
|
||||
Session_label const label = label_from_args(args);
|
||||
Session_policy const policy(label, _config);
|
||||
|
||||
char filename[256];
|
||||
policy.attribute("filename").value(filename, sizeof(filename));
|
||||
|
||||
if (policy.has_attribute("io_buffer_size"))
|
||||
policy.attribute("io_buffer_size").value(&io_buffer_size);
|
||||
|
||||
return new (md_alloc())
|
||||
Session_component(_env, io_buffer_size, filename);
|
||||
}
|
||||
catch (Genode::Xml_node::Nonexistent_attribute) {
|
||||
Genode::error("missing \"filename\" attribute in policy definition");
|
||||
throw Genode::Service_denied();
|
||||
}
|
||||
catch (Genode::Session_policy::No_policy_defined) {
|
||||
Genode::error("invalid session request, no matching policy");
|
||||
throw Genode::Service_denied();
|
||||
if (!policy.has_attribute("filename")) {
|
||||
error("missing \"filename\" attribute in policy definition");
|
||||
throw Service_denied();
|
||||
}
|
||||
|
||||
typedef String<256> File_name;
|
||||
File_name const file_name =
|
||||
policy.attribute_value("filename", File_name());
|
||||
|
||||
size_t const io_buffer_size =
|
||||
policy.attribute_value("io_buffer_size", 4096UL);
|
||||
|
||||
return new (md_alloc())
|
||||
Session_component(_env, io_buffer_size, file_name.string());
|
||||
}
|
||||
|
||||
public:
|
||||
|
Reference in New Issue
Block a user