summaryrefslogtreecommitdiff
path: root/Servers/TelnetServer
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-20 15:39:15 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-20 15:39:15 +0200
commitd1bacb9885ecaca7d5bd612f2501e9d32abf7411 (patch)
tree2697b0f614288a76655d728f26bc1d0237523feb /Servers/TelnetServer
parent50a65604130f9c0aea46799231e88ac956ac018b (diff)
downloadserenity-d1bacb9885ecaca7d5bd612f2501e9d32abf7411.zip
LibCore: Convert CNotifier to ObjectPtr
Diffstat (limited to 'Servers/TelnetServer')
-rw-r--r--Servers/TelnetServer/Client.cpp6
-rw-r--r--Servers/TelnetServer/Client.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/Servers/TelnetServer/Client.cpp b/Servers/TelnetServer/Client.cpp
index 485bb23134..6c71ac3231 100644
--- a/Servers/TelnetServer/Client.cpp
+++ b/Servers/TelnetServer/Client.cpp
@@ -14,10 +14,10 @@ Client::Client(int id, CTCPSocket* socket, int ptm_fd)
: m_id(id)
, m_socket(socket)
, m_ptm_fd(ptm_fd)
- , m_ptm_notifier(ptm_fd, CNotifier::Read)
+ , m_ptm_notifier(CNotifier::create(ptm_fd, CNotifier::Read))
{
m_socket->on_ready_to_read = [this] { drain_socket(); };
- m_ptm_notifier.on_ready_to_read = [this] { drain_pty(); };
+ m_ptm_notifier->on_ready_to_read = [this] { drain_pty(); };
m_parser.on_command = [this](const Command& command) { handle_command(command); };
m_parser.on_data = [this](const StringView& data) { handle_data(data); };
m_parser.on_error = [this]() { handle_error(); };
@@ -154,7 +154,7 @@ void Client::send_commands(Vector<Command> commands)
void Client::quit()
{
- m_ptm_notifier.set_enabled(false);
+ m_ptm_notifier->set_enabled(false);
close(m_ptm_fd);
m_socket->close();
if (on_exit)
diff --git a/Servers/TelnetServer/Client.h b/Servers/TelnetServer/Client.h
index 83956f8879..60e222cc98 100644
--- a/Servers/TelnetServer/Client.h
+++ b/Servers/TelnetServer/Client.h
@@ -39,5 +39,5 @@ private:
Parser m_parser;
// pty resources
int m_ptm_fd { -1 };
- CNotifier m_ptm_notifier;
+ ObjectPtr<CNotifier> m_ptm_notifier;
};