LibIPC: Address a couple of clangd warnings in IPC::TransportSocket

* We need the full definition of IPC::File in the header.
* We need(ed) Core::System in the header. Move AutoCloseFileDescriptor's
  ctor and dtor out-of-line to avoid this.
This commit is contained in:
Timothy Flynn 2025-05-20 12:31:35 -04:00 committed by Tim Flynn
commit 8b3355ed0d
Notes: github-actions[bot] 2025-05-21 10:56:27 +00:00
2 changed files with 14 additions and 11 deletions

View file

@ -8,11 +8,21 @@
#include <AK/NonnullOwnPtr.h>
#include <LibCore/Socket.h>
#include <LibCore/System.h>
#include <LibIPC/File.h>
#include <LibIPC/TransportSocket.h>
namespace IPC {
AutoCloseFileDescriptor::AutoCloseFileDescriptor(int fd)
: m_fd(fd)
{
}
AutoCloseFileDescriptor::~AutoCloseFileDescriptor()
{
if (m_fd != -1)
(void)Core::System::close(m_fd);
}
void SendQueue::enqueue_message(Vector<u8>&& bytes, Vector<int>&& fds)
{
Threading::MutexLocker locker(m_mutex);

View file

@ -10,6 +10,7 @@
#include <AK/MemoryStream.h>
#include <AK/Queue.h>
#include <LibCore/Socket.h>
#include <LibIPC/File.h>
#include <LibThreading/ConditionVariable.h>
#include <LibThreading/MutexProtected.h>
#include <LibThreading/RWLock.h>
@ -19,16 +20,8 @@ namespace IPC {
class AutoCloseFileDescriptor : public RefCounted<AutoCloseFileDescriptor> {
public:
AutoCloseFileDescriptor(int fd)
: m_fd(fd)
{
}
~AutoCloseFileDescriptor()
{
if (m_fd != -1)
(void)Core::System::close(m_fd);
}
AutoCloseFileDescriptor(int fd);
~AutoCloseFileDescriptor();
int value() const { return m_fd; }