diff --git a/repos/libports/src/lib/libc/vfs_plugin.cc b/repos/libports/src/lib/libc/vfs_plugin.cc index 7c73d20184..9b36f73fb8 100644 --- a/repos/libports/src/lib/libc/vfs_plugin.cc +++ b/repos/libports/src/lib/libc/vfs_plugin.cc @@ -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))) { diff --git a/repos/os/src/lib/vfs/inline_file_system.h b/repos/os/src/lib/vfs/inline_file_system.h index 1b2c60bc84..6554c0beb3 100644 --- a/repos/os/src/lib/vfs/inline_file_system.h +++ b/repos/os/src/lib/vfs/inline_file_system.h @@ -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)