mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:57:35 +00:00
Kernel: Add missing error check when opening TTY for a new process
This commit is contained in:
parent
4b3bc3805b
commit
d065de1fcf
1 changed files with 6 additions and 1 deletions
|
@ -164,7 +164,12 @@ RefPtr<Process> Process::create_user_process(RefPtr<Thread>& first_thread, const
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
auto& device_to_use_as_tty = tty ? (CharacterDevice&)*tty : NullDevice::the();
|
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) {
|
auto setup_description = [&process, &description](int fd) {
|
||||||
process->m_fds.m_fds_metadatas[fd].allocate();
|
process->m_fds.m_fds_metadatas[fd].allocate();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue