mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-22 08:50:09 +00:00
server/fs_report: do not append '.report to file names
Appending a suffix to report filenames was behavior inherited from fs_log, it prevents creating files where directories need to be created later. But unlike logs, only a subset of the hierarchy will report and those that do append a component-local label, so the risk of collision is low. By removing the suffix fs_rom can serve reports back as ROM just as report_rom does. Ref #2422
This commit is contained in:
committed by
Norman Feske
parent
2b569e37e1
commit
73eb7a52a0
@ -40,6 +40,8 @@ static bool create_parent_dir(Vfs::Directory_service &vfs, Path const &child)
|
||||
|
||||
Path parent = child;
|
||||
parent.strip_last_element();
|
||||
if (parent == "/")
|
||||
return true;
|
||||
|
||||
Mkdir_result res = vfs.mkdir(parent.base(), 0);
|
||||
if (res == Mkdir_result::MKDIR_ERR_NO_ENTRY) {
|
||||
@ -83,7 +85,6 @@ class Fs_report::Session_component : public Genode::Rpc_object<Report::Session>
|
||||
typedef Vfs::Directory_service::Open_result Open_result;
|
||||
|
||||
Path path = path_from_label<Path>(label.string());
|
||||
path.append(".report");
|
||||
|
||||
create_parent_dir(vfs, path);
|
||||
|
||||
@ -135,7 +136,7 @@ class Fs_report::Session_component : public Genode::Rpc_object<Report::Session>
|
||||
|
||||
_handle->seek(offset);
|
||||
Write_result res = _handle->fs().write(
|
||||
_handle, _ds.local_addr<char const>(),
|
||||
_handle, _ds.local_addr<char const>()+offset,
|
||||
length - offset, n);
|
||||
|
||||
if (res != Write_result::WRITE_OK) {
|
||||
|
Reference in New Issue
Block a user