mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
Catch 'File_system::Lookup_failed' exception
In 'Fs_file_system::open()' the call of '_fs.dir()' can throw a 'File_system::Lookup_failed' exception, which gets explicitly caught with this patch. Fixes #246.
This commit is contained in:
parent
4fc9383c31
commit
9a8fb36b1c
@ -335,11 +335,12 @@ namespace Noux {
|
||||
if (create)
|
||||
PDBG("creation of file %s requested", file_name.base() + 1);
|
||||
|
||||
::File_system::Dir_handle dir = _fs.dir(dir_path.base(), false);
|
||||
Fs_handle_guard dir_guard(_fs, dir);
|
||||
|
||||
Sysio::Open_error error = Sysio::OPEN_ERR_UNACCESSIBLE;
|
||||
|
||||
try {
|
||||
::File_system::Dir_handle dir = _fs.dir(dir_path.base(), false);
|
||||
Fs_handle_guard dir_guard(_fs, dir);
|
||||
|
||||
::File_system::File_handle file = _fs.file(dir, file_name.base() + 1,
|
||||
mode, create);
|
||||
return new (env()->heap()) Fs_vfs_handle(this, 0, file);
|
||||
@ -348,6 +349,7 @@ namespace Noux {
|
||||
error = Sysio::OPEN_ERR_NO_PERM; }
|
||||
catch (::File_system::Invalid_handle) {
|
||||
error = Sysio::OPEN_ERR_NO_PERM; }
|
||||
catch (::File_system::Lookup_failed) { }
|
||||
|
||||
sysio->error.open = error;
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user