diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-17 15:04:27 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-17 15:04:27 +0100 |
commit | 48f7c28a5cee78398c64d94f7dc3c6bf5a66ce77 (patch) | |
tree | c072ef54fa2e311ac8119e2f2f1ed69c5a22a061 /Kernel/Net/Socket.cpp | |
parent | 4f4af24b9d489634a66d818260a7f87964faf421 (diff) | |
download | serenity-48f7c28a5cee78398c64d94f7dc3c6bf5a66ce77.zip |
Kernel: Replace "current" with Thread::current and Process::current
Suggested by Sergey. The currently running Thread and Process are now
Thread::current and Process::current respectively. :^)
Diffstat (limited to 'Kernel/Net/Socket.cpp')
-rw-r--r-- | Kernel/Net/Socket.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Kernel/Net/Socket.cpp b/Kernel/Net/Socket.cpp index 3e279047ae..9d923e84bc 100644 --- a/Kernel/Net/Socket.cpp +++ b/Kernel/Net/Socket.cpp @@ -54,7 +54,7 @@ Socket::Socket(int domain, int type, int protocol) , m_type(type) , m_protocol(protocol) { - auto& process = current->process(); + auto& process = *Process::current; m_origin = { process.pid(), process.uid(), process.gid() }; } @@ -65,7 +65,7 @@ Socket::~Socket() void Socket::set_setup_state(SetupState new_setup_state) { #ifdef SOCKET_DEBUG - kprintf("%s(%u) Socket{%p} setup state moving from %s to %s\n", current->process().name().characters(), current->pid(), this, to_string(m_setup_state), to_string(new_setup_state)); + kprintf("%s(%u) Socket{%p} setup state moving from %s to %s\n", Process::current->name().characters(), Process::current->pid(), this, to_string(m_setup_state), to_string(new_setup_state)); #endif m_setup_state = new_setup_state; @@ -77,11 +77,11 @@ RefPtr<Socket> Socket::accept() if (m_pending.is_empty()) return nullptr; #ifdef SOCKET_DEBUG - kprintf("%s(%u) Socket{%p} de-queueing connection\n", current->process().name().characters(), current->pid(), this); + kprintf("%s(%u) Socket{%p} de-queueing connection\n", Process::current->name().characters(), Process::current->pid(), this); #endif auto client = m_pending.take_first(); ASSERT(!client->is_connected()); - auto& process = current->process(); + auto& process = *Process::current; client->m_acceptor = { process.pid(), process.uid(), process.gid() }; client->m_connected = true; client->m_role = Role::Accepted; @@ -91,7 +91,7 @@ RefPtr<Socket> Socket::accept() KResult Socket::queue_connection_from(NonnullRefPtr<Socket> peer) { #ifdef SOCKET_DEBUG - kprintf("%s(%u) Socket{%p} queueing connection\n", current->process().name().characters(), current->pid(), this); + kprintf("%s(%u) Socket{%p} queueing connection\n", Process::current->name().characters(), Process::current->pid(), this); #endif LOCKER(m_lock); if (m_pending.size() >= m_backlog) |