mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
parent
97f50e8e15
commit
3c07860aad
@ -762,19 +762,21 @@ class Vfs::Dir_file_system : public File_system
|
||||
Vfs_watch_handle **handle,
|
||||
Allocator &alloc) override
|
||||
{
|
||||
/* static by default, no allocations */
|
||||
Watch_result r = WATCH_ERR_STATIC;
|
||||
Watch_result res = WATCH_ERR_UNACCESSIBLE;
|
||||
Dir_watch_handle *meta_handle = nullptr;
|
||||
|
||||
char const *sub_path = _sub_path(path);
|
||||
if (!sub_path) return res;
|
||||
|
||||
for (File_system *fs = _first_file_system; fs; fs = fs->next) {
|
||||
Vfs_watch_handle *sub_handle;
|
||||
|
||||
if (fs->watch(path, &sub_handle, alloc) == WATCH_OK) {
|
||||
if (fs->watch(sub_path, &sub_handle, alloc) == WATCH_OK) {
|
||||
if (meta_handle == nullptr) {
|
||||
/* at least one non-static FS, allocate handle */
|
||||
meta_handle = new (alloc) Dir_watch_handle(*this, alloc);
|
||||
*handle = meta_handle;
|
||||
r = WATCH_OK;
|
||||
res = WATCH_OK;
|
||||
}
|
||||
|
||||
/* attach child FS handle to returned handle */
|
||||
@ -784,7 +786,7 @@ class Vfs::Dir_file_system : public File_system
|
||||
}
|
||||
}
|
||||
|
||||
return r;
|
||||
return res;
|
||||
}
|
||||
|
||||
void close(Vfs_watch_handle *handle) override
|
||||
|
@ -128,8 +128,7 @@ struct Vfs::Directory_service : Interface
|
||||
Allocator&)
|
||||
{
|
||||
/* default implementation for static file-systems */
|
||||
Genode::warning("'", path, "' is static and cannot be watched");
|
||||
return WATCH_ERR_STATIC;
|
||||
return (leaf_path(path)) ? WATCH_ERR_STATIC : WATCH_ERR_UNACCESSIBLE;
|
||||
}
|
||||
|
||||
virtual void close(Vfs_watch_handle *)
|
||||
|
Loading…
x
Reference in New Issue
Block a user