summaryrefslogtreecommitdiff
path: root/Kernel/MasterPTY.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-01-16 02:11:50 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-01-16 02:11:50 +0100
commit310a5f41997492d203fed6dd7b4ff77ce80f82ff (patch)
tree9958136053756379e54bf2e74cc9795547f5723d /Kernel/MasterPTY.cpp
parent9c51d9dfcd990ec4bc1707f8c17ee0fd1059d8f0 (diff)
downloadserenity-310a5f41997492d203fed6dd7b4ff77ce80f82ff.zip
Let each MasterPTY create its slave.
Diffstat (limited to 'Kernel/MasterPTY.cpp')
-rw-r--r--Kernel/MasterPTY.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/MasterPTY.cpp b/Kernel/MasterPTY.cpp
index 138d9bc5b0..7cb6f8b687 100644
--- a/Kernel/MasterPTY.cpp
+++ b/Kernel/MasterPTY.cpp
@@ -3,9 +3,10 @@
MasterPTY::MasterPTY(unsigned index)
: CharacterDevice(10, index)
+ , m_slave(*new SlavePTY(*this, index))
, m_index(index)
{
-
+ VFS::the().register_character_device(m_slave);
}
MasterPTY::~MasterPTY()
@@ -14,7 +15,6 @@ MasterPTY::~MasterPTY()
String MasterPTY::pts_name() const
{
- dbgprintf("MasterPTY::pts_name requested for index %u!\n", m_index);
char buffer[32];
ksprintf(buffer, "/dev/pts%u", m_index);
return buffer;
@@ -27,7 +27,7 @@ ssize_t MasterPTY::read(Process&, byte* buffer, size_t size)
ssize_t MasterPTY::write(Process&, const byte* buffer, size_t size)
{
- m_slave->on_master_write(buffer, size);
+ m_slave.on_master_write(buffer, size);
return size;
}