vfs: fix empty-node handling in inline fs

Now <inline></inline> as well as <inline/> are supported.
This commit is contained in:
Christian Helmuth 2019-06-11 09:45:41 +02:00
parent 4d34f9f9f4
commit 45f3ccc42a
2 changed files with 8 additions and 1 deletions

View File

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

View File

@ -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)