mirror of
https://github.com/RGBCube/serenity
synced 2025-07-03 02:02:07 +00:00
Kernel: Move TTY subsystem to use KString instead of AK::String
This is minor progress on removing the `AK::String` API from the Kernel in the interest of improving OOM safety.
This commit is contained in:
parent
71f05c70b4
commit
9f6eabd73a
10 changed files with 36 additions and 27 deletions
|
@ -35,12 +35,12 @@ bool SlavePTY::unref() const
|
|||
return did_hit_zero;
|
||||
}
|
||||
|
||||
SlavePTY::SlavePTY(MasterPTY& master, unsigned index)
|
||||
SlavePTY::SlavePTY(MasterPTY& master, unsigned index, NonnullOwnPtr<KString> tty_name)
|
||||
: TTY(201, index)
|
||||
, m_master(master)
|
||||
, m_index(index)
|
||||
, m_tty_name(move(tty_name))
|
||||
{
|
||||
m_tty_name = String::formatted("/dev/pts/{}", m_index);
|
||||
auto& process = Process::current();
|
||||
set_uid(process.uid());
|
||||
set_gid(process.gid());
|
||||
|
@ -54,9 +54,9 @@ SlavePTY::~SlavePTY()
|
|||
dbgln_if(SLAVEPTY_DEBUG, "~SlavePTY({})", m_index);
|
||||
}
|
||||
|
||||
String const& SlavePTY::tty_name() const
|
||||
KString const& SlavePTY::tty_name() const
|
||||
{
|
||||
return m_tty_name;
|
||||
return *m_tty_name;
|
||||
}
|
||||
|
||||
void SlavePTY::echo(u8 ch)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue