mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +00:00
Let each MasterPTY create its slave.
This commit is contained in:
parent
9c51d9dfcd
commit
310a5f4199
5 changed files with 18 additions and 30 deletions
|
@ -6,10 +6,10 @@
|
|||
class SlavePTY;
|
||||
|
||||
class MasterPTY final : public CharacterDevice {
|
||||
AK_MAKE_ETERNAL
|
||||
public:
|
||||
explicit MasterPTY(unsigned index);
|
||||
virtual ~MasterPTY() override;
|
||||
void set_slave(SlavePTY& slave) { m_slave = &slave; }
|
||||
|
||||
virtual ssize_t read(Process&, byte*, size_t) override;
|
||||
virtual ssize_t write(Process&, const byte*, size_t) override;
|
||||
|
@ -21,7 +21,7 @@ public:
|
|||
void on_slave_write(const byte*, size_t);
|
||||
|
||||
private:
|
||||
SlavePTY& m_slave;
|
||||
unsigned m_index;
|
||||
SlavePTY* m_slave { nullptr };
|
||||
DoubleBuffer m_buffer;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue