mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-29 15:44:02 +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,11 +758,15 @@ class Vfs::Rump_file_system : public File_system
|
||||
if (fd < 0)
|
||||
return WATCH_ERR_UNACCESSIBLE;
|
||||
|
||||
auto *watch_handle = new (alloc)
|
||||
Rump_watch_handle(*this, alloc, fd);
|
||||
_watchers.insert(watch_handle);
|
||||
*handle = watch_handle;
|
||||
return WATCH_OK;
|
||||
try {
|
||||
auto *watch_handle = new (alloc)
|
||||
Rump_watch_handle(*this, alloc, fd);
|
||||
_watchers.insert(watch_handle);
|
||||
*handle = watch_handle;
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user