mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
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:
parent
356727f294
commit
8b3355ed0d
Notes:
github-actions[bot]
2025-05-21 10:56:27 +00:00
Author: https://github.com/trflynn89
Commit: 8b3355ed0d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4828
Reviewed-by: https://github.com/shannonbooth ✅
2 changed files with 14 additions and 11 deletions
|
@ -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);
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue