diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-16 02:11:50 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-16 02:11:50 +0100 |
commit | 310a5f41997492d203fed6dd7b4ff77ce80f82ff (patch) | |
tree | 9958136053756379e54bf2e74cc9795547f5723d /Kernel/init.cpp | |
parent | 9c51d9dfcd990ec4bc1707f8c17ee0fd1059d8f0 (diff) | |
download | serenity-310a5f41997492d203fed6dd7b4ff77ce80f82ff.zip |
Let each MasterPTY create its slave.
Diffstat (limited to 'Kernel/init.cpp')
-rw-r--r-- | Kernel/init.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/Kernel/init.cpp b/Kernel/init.cpp index d7c42823f0..2348d53b88 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -23,7 +23,6 @@ #include "Scheduler.h" #include "PS2MouseDevice.h" #include "MasterPTY.h" -#include "SlavePTY.h" #define SPAWN_GUI_TEST_APP //#define SPAWN_MULTIPLE_SHELLS @@ -42,10 +41,6 @@ MasterPTY* ptm0; MasterPTY* ptm1; MasterPTY* ptm2; MasterPTY* ptm3; -SlavePTY* pts0; -SlavePTY* pts1; -SlavePTY* pts2; -SlavePTY* pts3; #ifdef STRESS_TEST_SPAWNING static void spawn_stress() NORETURN; @@ -66,16 +61,6 @@ static void spawn_stress() } #endif -static void make_pty_pair(unsigned index) -{ - auto* master = new MasterPTY(index); - auto* slave = new SlavePTY(index); - master->set_slave(*slave); - slave->set_master(*master); - VFS::the().register_character_device(*master); - VFS::the().register_character_device(*slave); -} - static void init_stage2() NORETURN; static void init_stage2() { @@ -95,10 +80,10 @@ static void init_stage2() auto dev_random = make<RandomDevice>(); vfs->register_character_device(*dev_random); - make_pty_pair(0); - make_pty_pair(1); - make_pty_pair(2); - make_pty_pair(3); + VFS::the().register_character_device(*new MasterPTY(0)); + VFS::the().register_character_device(*new MasterPTY(1)); + VFS::the().register_character_device(*new MasterPTY(2)); + VFS::the().register_character_device(*new MasterPTY(3)); vfs->register_character_device(*keyboard); vfs->register_character_device(*ps2mouse); |