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:
Norman Feske 2014-01-12 02:48:40 +01:00 committed by Christian Helmuth
parent 9cb603eb5f
commit f32a97da38
1 changed files with 3 additions and 3 deletions

View File

@ -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())
{ }