Kernel: open does not need TTY_INIT to set the controlling terminal

This commit is contained in:
2024-08-11 01:00:33 +03:00
parent a5a097fa4a
commit 4d1b32f770

View File

@@ -914,8 +914,8 @@ namespace Kernel
int fd = TRY(m_open_file_descriptors.open(file, flags)); int fd = TRY(m_open_file_descriptors.open(file, flags));
// Open controlling terminal // Open controlling terminal
if ((flags & O_TTY_INIT) && !(flags & O_NOCTTY) && file.inode->is_tty() && is_session_leader() && !m_controlling_terminal) if (!(flags & O_NOCTTY) && file.inode->is_tty() && is_session_leader() && !m_controlling_terminal)
m_controlling_terminal = (TTY*)file.inode.ptr(); m_controlling_terminal = static_cast<TTY*>(file.inode.ptr());
return fd; return fd;
} }