From 4d1b32f770be433ebe2559b57bfcc8418268b6e0 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sun, 11 Aug 2024 01:00:33 +0300 Subject: [PATCH] Kernel: open does not need TTY_INIT to set the controlling terminal --- kernel/kernel/Process.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/kernel/Process.cpp b/kernel/kernel/Process.cpp index 5190445285..5f1abbb547 100644 --- a/kernel/kernel/Process.cpp +++ b/kernel/kernel/Process.cpp @@ -914,8 +914,8 @@ namespace Kernel int fd = TRY(m_open_file_descriptors.open(file, flags)); // Open controlling terminal - if ((flags & O_TTY_INIT) && !(flags & O_NOCTTY) && file.inode->is_tty() && is_session_leader() && !m_controlling_terminal) - m_controlling_terminal = (TTY*)file.inode.ptr(); + if (!(flags & O_NOCTTY) && file.inode->is_tty() && is_session_leader() && !m_controlling_terminal) + m_controlling_terminal = static_cast(file.inode.ptr()); return fd; }