mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-06 11:10:24 +00:00
vfs_rump: reflect resource shortage as return values
The function Vfs::Directory_service::watch() is not expected to throw Out_of_ram/Out_of_caps but use dedicated Watch_result errors.
This commit is contained in:
parent
eb895975e2
commit
8a4f4fcea9
@ -758,12 +758,16 @@ class Vfs::Rump_file_system : public File_system
|
|||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return WATCH_ERR_UNACCESSIBLE;
|
return WATCH_ERR_UNACCESSIBLE;
|
||||||
|
|
||||||
|
try {
|
||||||
auto *watch_handle = new (alloc)
|
auto *watch_handle = new (alloc)
|
||||||
Rump_watch_handle(*this, alloc, fd);
|
Rump_watch_handle(*this, alloc, fd);
|
||||||
_watchers.insert(watch_handle);
|
_watchers.insert(watch_handle);
|
||||||
*handle = watch_handle;
|
*handle = watch_handle;
|
||||||
return WATCH_OK;
|
return WATCH_OK;
|
||||||
}
|
}
|
||||||
|
catch (Genode::Out_of_ram) { return WATCH_ERR_OUT_OF_RAM; }
|
||||||
|
catch (Genode::Out_of_caps) { return WATCH_ERR_OUT_OF_CAPS; }
|
||||||
|
}
|
||||||
|
|
||||||
void close(Vfs_watch_handle *vfs_handle) override
|
void close(Vfs_watch_handle *vfs_handle) override
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user