mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-01 07:00:55 +00:00
parent
3de673a8ca
commit
6c7356072d
@ -503,10 +503,14 @@ class Vfs::Fs_file_system : public File_system
|
|||||||
|
|
||||||
if (!packet_out.succeeded()) {
|
if (!packet_out.succeeded()) {
|
||||||
/* could be EOF or a real error */
|
/* could be EOF or a real error */
|
||||||
|
try {
|
||||||
::File_system::Status status = _fs.status(handle.file_handle());
|
::File_system::Status status = _fs.status(handle.file_handle());
|
||||||
if (seek_offset < status.size)
|
if (seek_offset < status.size)
|
||||||
Genode::warning("unexpected failure on file-system read");
|
Genode::warning("unexpected failure on file-system read");
|
||||||
}
|
}
|
||||||
|
catch (::File_system::Invalid_handle) { }
|
||||||
|
catch (::File_system::Unavailable) { }
|
||||||
|
}
|
||||||
|
|
||||||
file_size const read_num_bytes = min(packet_out.length(), count);
|
file_size const read_num_bytes = min(packet_out.length(), count);
|
||||||
|
|
||||||
@ -673,9 +677,9 @@ class Vfs::Fs_file_system : public File_system
|
|||||||
_fs, _env.io_handler());
|
_fs, _env.io_handler());
|
||||||
status = _fs.status(node);
|
status = _fs.status(node);
|
||||||
}
|
}
|
||||||
catch (::File_system::Lookup_failed) { return STAT_ERR_NO_ENTRY; }
|
|
||||||
catch (Genode::Out_of_ram) { return STAT_ERR_NO_PERM; }
|
catch (Genode::Out_of_ram) { return STAT_ERR_NO_PERM; }
|
||||||
catch (Genode::Out_of_caps) { return STAT_ERR_NO_PERM; }
|
catch (Genode::Out_of_caps) { return STAT_ERR_NO_PERM; }
|
||||||
|
catch (...) { return STAT_ERR_NO_ENTRY; }
|
||||||
|
|
||||||
out = Stat();
|
out = Stat();
|
||||||
|
|
||||||
@ -763,15 +767,17 @@ class Vfs::Fs_file_system : public File_system
|
|||||||
if (strcmp(path, "") == 0)
|
if (strcmp(path, "") == 0)
|
||||||
path = "/";
|
path = "/";
|
||||||
|
|
||||||
::File_system::Node_handle node;
|
try {
|
||||||
try { node = _fs.node(path); } catch (...) { return 0; }
|
::File_system::Node_handle node = _fs.node(path);
|
||||||
Fs_handle_guard node_guard(*this, _fs, node, _handle_space, _fs,
|
Fs_handle_guard node_guard(*this, _fs, node,
|
||||||
|
_handle_space, _fs,
|
||||||
_env.io_handler());
|
_env.io_handler());
|
||||||
|
|
||||||
::File_system::Status status = _fs.status(node);
|
::File_system::Status status = _fs.status(node);
|
||||||
|
|
||||||
return status.size / sizeof(::File_system::Directory_entry);
|
return status.size / sizeof(::File_system::Directory_entry);
|
||||||
}
|
}
|
||||||
|
catch (...) { }
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool directory(char const *path) override
|
bool directory(char const *path) override
|
||||||
{
|
{
|
||||||
@ -784,7 +790,8 @@ class Vfs::Fs_file_system : public File_system
|
|||||||
|
|
||||||
return status.directory();
|
return status.directory();
|
||||||
}
|
}
|
||||||
catch (...) { return false; }
|
catch (...) { }
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
char const *leaf_path(char const *path) override
|
char const *leaf_path(char const *path) override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user