From f32a97da38c758bcf1a570d8f4e64c306f9ae9bc Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Sun, 12 Jan 2014 02:48:40 +0100 Subject: [PATCH] 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 ) based on session arguments other than the label anymore. --- base/include/rom_session/connection.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/include/rom_session/connection.h b/base/include/rom_session/connection.h index af08b8b26..ef2016204 100644 --- a/base/include/rom_session/connection.h +++ b/base/include/rom_session/connection.h @@ -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(_create_session(filename, label)), Rom_session_client(cap()) { }