mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
Kernel: Add missing error check when opening TTY for a new process
This commit is contained in:
@@ -164,7 +164,12 @@ RefPtr<Process> Process::create_user_process(RefPtr<Thread>& first_thread, const
|
||||
return {};
|
||||
}
|
||||
auto& device_to_use_as_tty = tty ? (CharacterDevice&)*tty : NullDevice::the();
|
||||
auto description = device_to_use_as_tty.open(O_RDWR).value();
|
||||
auto description_or_error = device_to_use_as_tty.open(O_RDWR);
|
||||
if (description_or_error.is_error()) {
|
||||
error = description_or_error.error().error();
|
||||
return {};
|
||||
}
|
||||
auto& description = description_or_error.value();
|
||||
|
||||
auto setup_description = [&process, &description](int fd) {
|
||||
process->m_fds.m_fds_metadatas[fd].allocate();
|
||||
|
||||
Reference in New Issue
Block a user