mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 08:07:45 +00:00
Kernel: Don't panic if a call redirected to Device::open() has an error.
Just pass the error to the user. I hit this when opening so many Terminal windows that PTYMultiplexer::open() ran out of master/slave pairs.
This commit is contained in:
parent
6f966ca51d
commit
41c744b3c8
1 changed files with 5 additions and 4 deletions
|
@ -191,10 +191,11 @@ KResultOr<Retained<FileDescriptor>> VFS::open(const String& path, int options, m
|
|||
kprintf("VFS::open: no such device %u,%u\n", metadata.major_device, metadata.minor_device);
|
||||
return KResult(-ENODEV);
|
||||
}
|
||||
auto descriptor = (*it).value->open(options);
|
||||
ASSERT(!descriptor.is_error());
|
||||
descriptor.value()->set_original_inode(Badge<VFS>(), *inode_or_error.value());
|
||||
return descriptor;
|
||||
auto descriptor_or_error = (*it).value->open(options);
|
||||
if (descriptor_or_error.is_error())
|
||||
return descriptor_or_error.error();
|
||||
descriptor_or_error.value()->set_original_inode(Badge<VFS>(), *inode_or_error.value());
|
||||
return descriptor_or_error;
|
||||
}
|
||||
return FileDescriptor::create(*inode_or_error.value());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue