mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
vfs: fix empty-node handling in inline fs
Now <inline></inline> as well as <inline/> are supported.
This commit is contained in:
@@ -249,7 +249,7 @@ Libc::File_descriptor *Libc::Vfs_plugin::open(char const *path, int flags,
|
||||
|
||||
Vfs::Vfs_handle *handle = 0;
|
||||
|
||||
while (handle == 0) {
|
||||
while (handle == nullptr) {
|
||||
|
||||
switch (VFS_THREAD_SAFE(_root_dir.open(path, flags, &handle, _alloc))) {
|
||||
|
||||
|
||||
@@ -120,6 +120,13 @@ class Vfs::Inline_file_system : public Single_file_system
|
||||
if (!_single_file(path))
|
||||
return OPEN_ERR_UNACCESSIBLE;
|
||||
|
||||
/* empty node */
|
||||
if (_node.content_size() == 0) {
|
||||
*out_handle = new (alloc)
|
||||
Inline_vfs_handle(*this, *this, alloc, nullptr, 0);
|
||||
return OPEN_OK;
|
||||
}
|
||||
|
||||
try {
|
||||
_node.with_raw_content([&] (char const *base, Genode::size_t size) {
|
||||
*out_handle = new (alloc)
|
||||
|
||||
Reference in New Issue
Block a user