mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
Use filename as default label for ROM connections
By assigning the file name as label, we may become able to remove the filename argument in the future by just interpreting the last part of the label as filename. By keeping only the label, we won't need to consider conditional routing (via <if-arg>) based on session arguments other than the label anymore.
This commit is contained in:
parent
9cb603eb5f
commit
f32a97da38
@ -32,8 +32,8 @@ namespace Genode {
|
||||
Rom_session_capability _create_session(const char *filename, const char *label)
|
||||
{
|
||||
try {
|
||||
return session("ram_quota=4K, filename=\"%s\", label=%s",
|
||||
filename, label); }
|
||||
return session("ram_quota=4K, filename=\"%s\", label=\"%s\"",
|
||||
filename, label ? label: filename); }
|
||||
catch (...) {
|
||||
PERR("Could not open file \"%s\"", filename);
|
||||
throw Rom_connection_failed();
|
||||
@ -50,7 +50,7 @@ namespace Genode {
|
||||
*
|
||||
* \throw Rom_connection_failed
|
||||
*/
|
||||
Rom_connection(const char *filename, const char *label = "") :
|
||||
Rom_connection(const char *filename, const char *label = 0) :
|
||||
Connection<Rom_session>(_create_session(filename, label)),
|
||||
Rom_session_client(cap())
|
||||
{ }
|
||||
|
Loading…
x
Reference in New Issue
Block a user