1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:08:12 +00:00

Kernel: Have TTY subclasses cache their tty_name/pts_name.

This commit is contained in:
Andreas Kling 2019-04-16 00:35:02 +02:00
parent d384c7815f
commit 88f03f86ff
6 changed files with 9 additions and 3 deletions

View file

@ -10,6 +10,7 @@ SlavePTY::SlavePTY(MasterPTY& master, unsigned index)
, m_master(master)
, m_index(index)
{
m_tty_name = String::format("/dev/pts/%u", m_index);
set_uid(current->process().uid());
set_gid(current->process().gid());
DevPtsFS::the().register_slave_pty(*this);
@ -26,7 +27,7 @@ SlavePTY::~SlavePTY()
String SlavePTY::tty_name() const
{
return String::format("/dev/pts/%u", m_index);
return m_tty_name;
}
void SlavePTY::on_master_write(const byte* buffer, ssize_t size)